OSDN Git Service

Regular updates
[twpd/master.git] / bolt.md
1 ---
2 title: Bolt Quickstart
3 category: Bolt
4 layout: 2017/sheet
5 updated: 2018-12-25
6 authors:
7   - github: lucywyman
8 keywords:
9     - Puppet
10     - tasks
11     - modules
12 description: |
13   A quick guide to getting started writing Bolt tasks
14 ---
15
16 ### Install Bolt
17
18 ```bash
19 # On MacOS
20 brew cask install puppetlabs/puppet/puppet-bolt
21 # On Windows
22 choco install puppet-bolt
23 ```
24
25 Bolt is available as a package for most platforms. See [installing bolt](https://puppet.com/docs/bolt/latest/bolt_installing.html)
26
27 ### Create a module with a task
28
29 ```bash
30 mkdir -p ~/.puppetlabs/bolt/modules/mymodule/tasks
31 cp myscript.sh ~/.puppetlabs/bolt/modules/mymodule/tasks/
32 ```
33
34 Tasks can be written in any language your targets can run. See [writing tasks](https://puppet.com/docs/bolt/latest/writing_tasks.html) for more details.
35
36 ### Run Bolt
37
38 ```bash
39 bolt task run mymodule::myscript -n node1.example.com,node2.example.com --private-key ~/.ssh/id_rsa-private
40 ```
41
42 See `bolt task run --help` for more information and command line options.