chake 0.20 → 0.81

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.ackrc +2 -0
  3. data/.gitignore +22 -0
  4. data/.gitlab-ci.yml +24 -0
  5. data/.manifest +65 -0
  6. data/.rubocop.yml +55 -0
  7. data/.rubocop_todo.yml +40 -0
  8. data/ChangeLog.md +36 -0
  9. data/README.chef.md +70 -0
  10. data/README.itamae.md +58 -0
  11. data/README.md +118 -85
  12. data/README.shell.md +30 -0
  13. data/Rakefile +36 -10
  14. data/bin/chake +2 -2
  15. data/chake.gemspec +16 -16
  16. data/examples/test/.ssh_config +4 -0
  17. data/examples/test/Rakefile +1 -1
  18. data/examples/test/Vagrantfile +6 -0
  19. data/examples/test/config.rb +4 -4
  20. data/examples/test/cookbooks/basics/recipes/default.rb +1 -0
  21. data/examples/test/cookbooks/example/files/default/test +1 -0
  22. data/examples/test/cookbooks/example/files/{host-homer → host-lemur}/test.asc +0 -0
  23. data/lib/chake.rb +110 -154
  24. data/lib/chake/bootstrap/chef/01_installed.sh +4 -0
  25. data/lib/chake/bootstrap/{01_debian.sh → chef/02_debian.sh} +0 -0
  26. data/lib/chake/bootstrap/{99_unsupported.sh → chef/99_unsupported.sh} +0 -0
  27. data/lib/chake/config.rb +2 -7
  28. data/lib/chake/config_manager.rb +89 -0
  29. data/lib/chake/config_manager/chef.rb +35 -0
  30. data/lib/chake/config_manager/itamae.rb +57 -0
  31. data/lib/chake/config_manager/shell.rb +34 -0
  32. data/lib/chake/config_manager/skel/chef/Rakefile +1 -0
  33. data/lib/chake/config_manager/skel/chef/config.rb +4 -0
  34. data/lib/chake/config_manager/skel/chef/cookbooks/basics/recipes/default.rb +1 -0
  35. data/lib/chake/config_manager/skel/chef/nodes.yaml +3 -0
  36. data/lib/chake/config_manager/skel/itamae/Rakefile +1 -0
  37. data/lib/chake/config_manager/skel/itamae/cookbooks/basics/default.rb +1 -0
  38. data/lib/chake/config_manager/skel/itamae/nodes.yaml +3 -0
  39. data/lib/chake/config_manager/skel/itamae/roles/basic.rb +1 -0
  40. data/lib/chake/config_manager/skel/shell/Rakefile +1 -0
  41. data/lib/chake/config_manager/skel/shell/nodes.yaml +3 -0
  42. data/lib/chake/connection.rb +83 -0
  43. data/lib/chake/{backend → connection}/local.rb +2 -8
  44. data/lib/chake/{backend → connection}/ssh.rb +6 -14
  45. data/lib/chake/node.rb +49 -29
  46. data/lib/chake/readline.rb +6 -10
  47. data/lib/chake/version.rb +1 -1
  48. data/lib/chake/wipe.rb +18 -0
  49. data/man/.gitignore +2 -0
  50. data/man/Rakefile +28 -14
  51. data/man/readme2man.sed +5 -5
  52. data/spec/chake/backend/local_spec.rb +5 -6
  53. data/spec/chake/backend/ssh_spec.rb +8 -10
  54. data/spec/chake/backend_spec.rb +1 -2
  55. data/spec/chake/config_manager/chef_spec.rb +38 -0
  56. data/spec/chake/config_manager/itamae_spec.rb +87 -0
  57. data/spec/chake/config_manager/shell_spec.rb +54 -0
  58. data/spec/chake/config_manager_spec.rb +23 -0
  59. data/spec/chake/node_spec.rb +38 -15
  60. data/spec/spec_helper.rb +37 -17
  61. metadata +65 -39
  62. data/coverage/assets/0.10.0/application.css +0 -799
  63. data/coverage/assets/0.10.0/application.js +0 -34783
  64. data/coverage/assets/0.10.0/colorbox/border.png +0 -0
  65. data/coverage/assets/0.10.0/colorbox/controls.png +0 -0
  66. data/coverage/assets/0.10.0/colorbox/loading.gif +0 -0
  67. data/coverage/assets/0.10.0/colorbox/loading_background.png +0 -0
  68. data/coverage/assets/0.10.0/favicon_green.png +0 -0
  69. data/coverage/assets/0.10.0/favicon_red.png +0 -0
  70. data/coverage/assets/0.10.0/favicon_yellow.png +0 -0
  71. data/coverage/assets/0.10.0/loading.gif +0 -0
  72. data/coverage/assets/0.10.0/magnify.png +0 -0
  73. data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  74. data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  75. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  76. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  77. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  78. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  79. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  80. data/coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  81. data/coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
  82. data/coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  83. data/coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
  84. data/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
  85. data/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  86. data/coverage/index.html +0 -2326
  87. data/lib/chake/backend.rb +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c280eaf2be46da4a40961d0400b016f0ff0ef72128364aba7036e38352094e36
4
- data.tar.gz: 524153c1f273985a79a19469f5ba92221bdd9d37ea13dcb9e837a22e6a897cac
3
+ metadata.gz: 8b68eda0401a07074704cfd0627f29423cd659a29a048e30afb60eb14c78c7e0
4
+ data.tar.gz: 031031b2e5bb12c185c974960aa1dd0dd538c31323510f1cb90843c9f7981dca
5
5
  SHA512:
6
- metadata.gz: a575c55efd94da9c4afa4c7405034b66fa47fa9e696d02164d66ec092594554cc1cc03f73c7e04ff9dd72fe26be08e036467aa2604653c1081857eccefcd25e8
7
- data.tar.gz: 8eabb88450699a987fa6f0e545bfff4ac69cac94634bea890581d8b8b914608fa260018c54178923f83823e5173e4bb9d163d484c4d2f97e032e7be879f37a80
6
+ metadata.gz: 51c7b6ad543209fb895f25b7f436f882731e1bc60880dd66e37a7240ec03bd3608bb99b4fcc8611caf3d9203394389e76f9c6608d8d98242b5119e0ccc87b20f
7
+ data.tar.gz: 7270ec17c14d6adc02230b57042a1f4585b706761facef2f8118cb1980cd61c8ea87d4899b52232bfa6a8574f31db3bd69287b7178803cd42783164f61f3e3bf
data/.ackrc ADDED
@@ -0,0 +1,2 @@
1
+ --ignore-dir=coverage
2
+ --ignore-dir=pkg
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ /examples/test/nodes.yaml
19
+ /examples/test/.tmp
20
+ .*.html
21
+ *.1
22
+ *.7
@@ -0,0 +1,24 @@
1
+ image: debian:testing
2
+
3
+ .install: &install
4
+ - apt-get update && apt-get install -qy ruby asciidoctor ruby-bundler ruby-rspec rubocop ruby-simplecov codespell ronn
5
+
6
+ tests:
7
+ before_script: *install
8
+ script:
9
+ - rake test
10
+
11
+ manpages:
12
+ before_script: *install
13
+ script:
14
+ - rake man
15
+
16
+ style:
17
+ before_script: *install
18
+ script:
19
+ - rake style
20
+
21
+ codespell:
22
+ before_script: *install
23
+ script:
24
+ - rake codespell
@@ -0,0 +1,65 @@
1
+ .ackrc
2
+ .gitignore
3
+ .gitlab-ci.yml
4
+ .manifest
5
+ .rubocop.yml
6
+ .rubocop_todo.yml
7
+ ChangeLog.md
8
+ Gemfile
9
+ LICENSE.txt
10
+ README.chef.md
11
+ README.itamae.md
12
+ README.md
13
+ README.shell.md
14
+ Rakefile
15
+ bin/chake
16
+ chake.gemspec
17
+ chake.spec.erb
18
+ examples/test/.ssh_config
19
+ examples/test/Rakefile
20
+ examples/test/Vagrantfile
21
+ examples/test/config.rb
22
+ examples/test/cookbooks/basics/recipes/default.rb
23
+ examples/test/cookbooks/example/files/default/test
24
+ examples/test/cookbooks/example/files/host-lemur/test.asc
25
+ examples/test/cookbooks/example/recipes/default.rb
26
+ lib/chake.rb
27
+ lib/chake/bootstrap/00_set_hostname.sh
28
+ lib/chake/bootstrap/chef/01_installed.sh
29
+ lib/chake/bootstrap/chef/02_debian.sh
30
+ lib/chake/bootstrap/chef/99_unsupported.sh
31
+ lib/chake/config.rb
32
+ lib/chake/config_manager.rb
33
+ lib/chake/config_manager/chef.rb
34
+ lib/chake/config_manager/itamae.rb
35
+ lib/chake/config_manager/shell.rb
36
+ lib/chake/config_manager/skel/chef/Rakefile
37
+ lib/chake/config_manager/skel/chef/config.rb
38
+ lib/chake/config_manager/skel/chef/cookbooks/basics/recipes/default.rb
39
+ lib/chake/config_manager/skel/chef/nodes.yaml
40
+ lib/chake/config_manager/skel/itamae/Rakefile
41
+ lib/chake/config_manager/skel/itamae/cookbooks/basics/default.rb
42
+ lib/chake/config_manager/skel/itamae/nodes.yaml
43
+ lib/chake/config_manager/skel/itamae/roles/basic.rb
44
+ lib/chake/config_manager/skel/shell/Rakefile
45
+ lib/chake/config_manager/skel/shell/nodes.yaml
46
+ lib/chake/connection.rb
47
+ lib/chake/connection/local.rb
48
+ lib/chake/connection/ssh.rb
49
+ lib/chake/node.rb
50
+ lib/chake/readline.rb
51
+ lib/chake/tmpdir.rb
52
+ lib/chake/version.rb
53
+ lib/chake/wipe.rb
54
+ man/.gitignore
55
+ man/Rakefile
56
+ man/readme2man.sed
57
+ spec/chake/backend/local_spec.rb
58
+ spec/chake/backend/ssh_spec.rb
59
+ spec/chake/backend_spec.rb
60
+ spec/chake/config_manager/chef_spec.rb
61
+ spec/chake/config_manager/itamae_spec.rb
62
+ spec/chake/config_manager/shell_spec.rb
63
+ spec/chake/config_manager_spec.rb
64
+ spec/chake/node_spec.rb
65
+ spec/spec_helper.rb
@@ -0,0 +1,55 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ NewCops: enable
5
+ Exclude:
6
+ - pkg/**/*
7
+
8
+ Layout/LineLength:
9
+ Enabled: false
10
+
11
+ Metrics/AbcSize:
12
+ Enabled: false
13
+
14
+ Metrics/BlockLength:
15
+ Enabled: false
16
+
17
+ Metrics/MethodLength:
18
+ Enabled: false
19
+
20
+ Metrics/PerceivedComplexity:
21
+ Enabled: false
22
+
23
+ Style/Documentation:
24
+ Enabled: false
25
+
26
+ Style/FormatString:
27
+ EnforcedStyle: percent
28
+
29
+ Style/FrozenStringLiteralComment:
30
+ Enabled: false
31
+
32
+ Style/GlobalVars:
33
+ Exclude:
34
+ - lib/chake.rb
35
+
36
+ Style/GuardClause:
37
+ Enabled: false
38
+
39
+ Style/HashEachMethods:
40
+ Enabled: false
41
+
42
+ Style/HashTransformKeys:
43
+ Enabled: false
44
+
45
+ Style/HashTransformValues:
46
+ Enabled: false
47
+
48
+ Style/IfUnlessModifier:
49
+ Enabled: false
50
+
51
+ Style/SymbolArray:
52
+ Enabled: false
53
+
54
+ Gemspec/RequiredRubyVersion:
55
+ Enabled: false
@@ -0,0 +1,40 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-03-25 17:43:43 -0300 using RuboCop version 0.52.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: EnforcedStyle.
12
+ # SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
13
+ Layout/HeredocIndentation:
14
+ Exclude:
15
+ - 'lib/chake.rb'
16
+
17
+ # Offense count: 3
18
+ Lint/AmbiguousOperator:
19
+ Exclude:
20
+ - 'lib/chake.rb'
21
+
22
+ # Offense count: 1
23
+ Lint/InterpolationCheck:
24
+ Exclude:
25
+ - 'lib/chake.rb'
26
+
27
+ # Offense count: 1
28
+ # Configuration parameters: Blacklist.
29
+ # Blacklist: END, (?-mix:EO[A-Z]{1})
30
+ Naming/HeredocDelimiterNaming:
31
+ Exclude:
32
+ - 'lib/chake.rb'
33
+
34
+ # Offense count: 1
35
+ # Cop supports --auto-correct.
36
+ # Configuration parameters: AutoCorrect, EnforcedStyle.
37
+ # SupportedStyles: nested, compact
38
+ Style/ClassAndModuleChildren:
39
+ Exclude:
40
+ - 'bin/chake'
@@ -1,3 +1,39 @@
1
+ # 0.81
2
+
3
+ * bootstrap/chef: exit if chef-solo is available
4
+ * Always bootstrap nodes
5
+ * Decrypt files in place when upload is not needed
6
+ * itamae: handle silent mode
7
+ * manpages: drop accute accent erroneously added by ronn
8
+
9
+ # 0.80
10
+
11
+ This release adds support for multiple configuration managers. Chef is now only
12
+ one of the options. There is also now support for configuration management with
13
+ itamae, and lightweight configuration management tool inspired by Chef, and via
14
+ shell commands. This should be mostly transparent to current Chef users, but
15
+ new repositories initiatied by chake will use itamae by default.
16
+
17
+ Other notable changes:
18
+
19
+ * rake nodes: list configuration manager and format as table
20
+ * Chake::Connection: fix handling of stderr
21
+ * Rebootstrap nodes when changing config managers
22
+ * bootstrap, upload: skip when config manager does not need them
23
+
24
+ # 0.21.2
25
+
26
+ * Chake::Backend#run: don't strip leading whitespace
27
+
28
+ # 0.21.1
29
+
30
+ * Fix converge when the connection is not already made as root. This bug was
31
+ introduced by the change in the previous release.
32
+
33
+ # 0.21
34
+
35
+ * converge, apply: allow removing data from the node JSON attributes
36
+
1
37
  # 0.20
2
38
 
3
39
  * check: give some feedback by running `sudo echo OK` instead of `sudo true`
@@ -0,0 +1,70 @@
1
+ chake-chef(7) -- configure chake nodes with chef-solo
2
+ =====================================================
3
+
4
+ ## Description
5
+
6
+ This configuration manager will allow you to manage nodes by running
7
+ **chef-solo(1)** on each remote node.
8
+
9
+ When `chake init` runs, the following chef-specific files will be created:
10
+
11
+ A brief explanation of the created files that are specific to **chef**:
12
+
13
+ * `config.rb`: contains the chef-solo configuration. You can modify it, but
14
+ usually you won't need to.
15
+ * `config/roles`: directory is where you can put your role definitions.
16
+ * `cookbooks`: directory where you will store your cookbooks. A sample cookbook
17
+ called "basics" is created, but feel free to remove it and add actual
18
+ cookbooks.
19
+
20
+ ## Configuration
21
+
22
+ Nodes can be configured to be managed with chef by having a `run_list` key in
23
+ their configuration:
24
+
25
+ ```yaml
26
+ host1.mycompany.com:
27
+ run_list:
28
+ - role[server]
29
+ - recipe[service1]
30
+ service1:
31
+ option1: "here we go"
32
+ ```
33
+
34
+ Any extra configuration under `host1.mycompany.com` will be saved to a JSON file
35
+ and given to the chef-solo --node-json option in the command line. For example,
36
+ the above configuration will produce a JSON file that looks like this:
37
+
38
+ ```json
39
+ {
40
+ "run_list": [
41
+ "role[server]",
42
+ "recipe[service1]"
43
+ ]
44
+ ,
45
+ "service1": {
46
+ "option1": "here we go"
47
+ }
48
+ }
49
+ ```
50
+
51
+ Inside Chef recipes, you can access those values by using the `node` object.
52
+ For example:
53
+
54
+ ```ruby
55
+ template "/etc/service1.conf.d/option1.conf" do
56
+ variables option1: node["option1"]
57
+ end
58
+ ```
59
+
60
+ ## Bootstrapping
61
+
62
+ The bootstrap process for _chef_ involves getting chef-solo installed. The
63
+ node hostname will also be set based on the hostname informed in the
64
+ configuration file.
65
+
66
+ ## See also
67
+
68
+ * **chake(1)**
69
+ * <https://docs.chef.io/>
70
+ * <https://docs.chef.io/chef_solo.html>
@@ -0,0 +1,58 @@
1
+ chake-itamae(7) -- configure chake nodes with itamae
2
+ ====================================================
3
+
4
+ ## Description
5
+
6
+ This configuration manager will run **itamae(1)** against your nodes.
7
+
8
+ ## Configuration
9
+
10
+ The _itamae_ configuration manager requires one key called `itamae`, and the
11
+ value must be a list of strings representing the list of recipes to apply to
12
+ the node when converging.
13
+
14
+ ```yaml
15
+ host1.mycompany.com:
16
+ itamae:
17
+ - cookbooks/basic/default.rb
18
+ - roles/server.rb
19
+ service1:
20
+ option1: "here we go"
21
+ ```
22
+
23
+ Any extra configuration under `host1.mycompany.com` will be saved to a JSON file
24
+ and given to the itamae --node-json option in the command line. For example,
25
+ the above configuration will produce a JSON file that looks like this:
26
+
27
+ ```json
28
+ {
29
+ "itamae": [
30
+ "cookbooks/basic.rb",
31
+ "roles/server.rb"
32
+ ]
33
+ ,
34
+ "service1": {
35
+ "option1": "here we go"
36
+ }
37
+ }
38
+ ```
39
+
40
+ Inside itamae recipes, you can access those values by using the `node` object.
41
+ For example:
42
+
43
+ ```ruby
44
+ template "/etc/service1.conf.d/option1.conf" do
45
+ variables option1: node["option1"]
46
+ end
47
+ ```
48
+
49
+ ## Bootstrapping
50
+
51
+ Very little bootstrapping is required for this configuration manager, as itamae
52
+ requires no setup on the node site since the Ruby code in the recipes is
53
+ interpreted locally and not on the nodes. During bootstrapping, only the node
54
+ hostname will be set according to your chake configuration.
55
+
56
+ ## See also
57
+
58
+ * **chake(1)**
data/README.md CHANGED
@@ -1,42 +1,58 @@
1
- # chake(1)
1
+ chake(1) -- serverless configuration management tool
2
+ ========================================
2
3
 
3
- ## NAME
4
+ ## SYNOPSIS
4
5
 
5
- chake - serverless configuration with chef
6
+ `chake` init
6
7
 
7
- ## Introduction
8
+ `chake` [rake arguments]
8
9
 
9
- chake is a tool that helps you manage multiple hosts with, without the need for
10
- a chef server. Configuration is managed in a local directory, which should
11
- probably be under version control with **git(1)** or anything else.
12
- Configuration is usually deployed via rsync over SSH, and applied by invoking
13
- **chef-solo(1)** over SSH on each host.
10
+ ## Description
14
11
 
15
- ## Installation
12
+ chake is a tool that helps you manage multiple hosts without the need for a
13
+ central server. Configuration is managed in a local directory, which should
14
+ (but doesn't need to) be under version control with **git(1)** or any other
15
+ version control system.
16
16
 
17
- $ gem install chake
17
+ Configuration is deployed to managed hosts remotely, either by invoking a
18
+ configuration management tool that will connect to them, or by first uploading
19
+ the necessary configuration and them remotely running a tool on the hosts.
18
20
 
19
- ## Creating the repository
21
+ ## Supported configuration managers.
20
22
 
21
- ```
22
- $ chake init
23
- [create] nodes.yaml
24
- [ mkdir] nodes.d/
25
- [create] config.rb
26
- [ mkdir] config/roles
27
- [ mkdir] cookbooks/basics/recipes/
28
- [create] cookbooks/basics/recipes/default.rb
29
- [create] Rakefile
30
- ```
23
+ chake supports the following configuration management tools:
24
+
25
+ * **itamae**: configuration is applied by running the itamae command line tool
26
+ on the management host; no configuration needs to be uploaded to the managed
27
+ hosts. See chake-itamae(7) for details.
28
+ * **shell**: the local repository is copied to the host, and the shell commands
29
+ specified in the node configuration is executed from the directory where that
30
+ copy is. See chake-shell(7) for details.
31
+ * **chef**: the local repository is copied to the host, and **chef-solo** is
32
+ executed remotely on the managed host. See chake-chef(7) for details.
33
+
34
+ Beyond applying configuration management recipes on the hosts, chake also
35
+ provides useful tools to manage multiple hosts, such as listing nodes, running
36
+ commands against all of them simultaneously, logging in to interactive
37
+ shells, and others.
38
+
39
+ ## creating the repository
40
+
41
+ $ chake init[:configmanager]
31
42
 
32
- A brief explanation of the created files:
43
+ This will create an initial directory structure. Some of the files are specific
44
+ to your your chosen **configmanager**, which can be one of [SUPPORTED
45
+ CONFIGURATION MANAGERS]. The following files, though, will be common to any
46
+ usage of chake:
33
47
 
34
- * `nodes.yaml`: where you will list the hosts you will be managing, and what recipes to apply to each of them.
35
- * `nodes.d`: a directory with multiple files in the same format as nodes.yaml. All files matching `*.yaml` in it will be added to the list of nodes.
36
- * `config.rb`: contains the chef-solo configuration. You can modify it, but usually you won't need to.
37
- * `config/roles`: directory is where you can put your role definitions.
38
- * `cookbooks`: directory where you will store your cookbooks. A sample cookbook called "basics" is created, but feel free to remove it and add actual cookbooks.
39
- * `Rakefile`: Contains just the `require 'chake'` line. You can augment it with other tasks specific to your intrastructure.
48
+ * `nodes.yaml`: where you will list the hosts you will be managing, and what
49
+ recipes to apply to each of them.
50
+ * `nodes.d`: a directory with multiple files in the same format as nodes.yaml.
51
+ All files matching `*.yaml` in it will be added to the list of nodes.
52
+ * `Rakefile`: Contains just the `require 'chake'` line. You can augment it with
53
+ other tasks specific to your intrastructure.
54
+
55
+ If you omit _configmanager_, `itamae` will be used by default.
40
56
 
41
57
  After the repository is created, you can call either `chake` or `rake`, as they
42
58
  are completely equivalent.
@@ -48,10 +64,12 @@ following:
48
64
 
49
65
  ```yaml
50
66
  host1.mycompany.com:
51
- run_list:
52
- - recipe[basics]
67
+ itamae:
68
+ - roles/basic.rb
53
69
  ```
54
70
 
71
+ The exact contents depends on the chosen configuration management tool.
72
+
55
73
  You can list your hosts with `rake nodes`:
56
74
 
57
75
  ```
@@ -63,11 +81,11 @@ To add more nodes, just append to `nodes.yaml`:
63
81
 
64
82
  ```yaml
65
83
  host1.mycompany.com:
66
- run_list:
67
- - recipe[basics]
84
+ itamae:
85
+ - roles/basic.rb
68
86
  host2.mycompany.com:
69
- run_list:
70
- - recipes[basics]
87
+ itamae:
88
+ - roles/basic.rb
71
89
  ```
72
90
 
73
91
  And chake now knows about your new node:
@@ -100,55 +118,53 @@ password prompts, you can:
100
118
 
101
119
  ## Checking connectivity and initial host setup
102
120
 
103
- To check whether hosts are correcly configured, you can use the `check` task:
121
+ To check whether hosts are correctly configured, you can use the `check` task:
104
122
 
105
- ```bash
123
+ ```
106
124
  $ rake check
107
125
  ```
108
126
 
109
127
  That will run the the `sudo true` command on each host. If that pass without
110
- you having to passwords, you are sure that
128
+ you having to type any passwords, it means that:
111
129
 
112
130
  * you have SSH access to each host; and
113
131
  * the user you are connecting as has password-less sudo correctly setup.
114
132
 
115
- ```bash
116
- $ rake check
117
- ```
118
-
119
- ## Applying cookbooks
133
+ ## Applying configuration
120
134
 
121
135
  Note that by default all tasks that apply to all hosts will run in parallel,
122
136
  using rake's support for multitasks. If for some reason you need to prevent
123
137
  that, you can pass `-j1` (or --jobs=1`) in the rake invocation. Note that by
124
138
  default rake will only run N+4 tasks in parallel, where N is the number of
125
139
  cores on the machine you are running it. If you have more than N+4 hosts and
126
- want all of them to be handled in parallel, you might want o pass `-j` (or
140
+ want all of them to be handled in parallel, you might want to pass `-j` (or
127
141
  `--jobs`), without any number, as the last argument; with that rake will have
128
142
  no limit on the number of tasks to perform in parallel.
129
143
 
130
-
131
144
  To apply the configuration to all nodes, run
132
145
 
133
- ```bash
146
+ ```
134
147
  $ rake converge
135
148
  ```
136
149
 
137
150
  To apply the configuration to a single node, run
138
151
 
139
- ```bash
152
+ ```
140
153
  $ rake converge:$NODE
141
154
  ```
142
155
 
143
156
  To apply a single recipe on all nodes, run
144
157
 
145
- ```bash
158
+ ```
146
159
  $ rake apply[myrecipe]
147
160
  ```
148
161
 
162
+ What `recipe` is depends on the configuration manager.
163
+
164
+
149
165
  To apply a single recipe on a specific node, run
150
166
 
151
- ```bash
167
+ ```
152
168
  $ rake apply:$NODE[myrecipe]
153
169
  ```
154
170
 
@@ -156,12 +172,24 @@ If you don't inform a recipe in the command line, you will be prompted for one.
156
172
 
157
173
  To run a shell command on all nodes, run
158
174
 
175
+ ```
176
+ $ rake run
177
+ ```
178
+ The above will prompt you for a command, then execute it on all nodes.
179
+
180
+ To pass the command to run in the command line, use the following syntax:
181
+
159
182
  ```
160
183
  $ rake run[command]
161
184
  ```
162
185
 
163
186
  If the `command` you want to run contains spaces, or other characters that are
164
- special do the shell, you have to quote them.
187
+ special do the shell, you have to quote them, for example:
188
+
189
+ ```
190
+ $ rake run["cat /etc/hostname"]
191
+ ```
192
+
165
193
 
166
194
  To run a shell command on a specific node, run
167
195
 
@@ -169,28 +197,29 @@ To run a shell command on a specific node, run
169
197
  $ rake run:$NODE[command]
170
198
  ```
171
199
 
172
- If you don't inform a command in the command line, you will be prompted for
173
- one.
200
+ As before, if you run just `rake run:$NODE`, you will be prompted for the
201
+ command.
174
202
 
175
- To check the existing tasks, run
203
+ To list all existing tasks, run:
176
204
 
177
- ```bash
205
+ ```
178
206
  $ rake -T
179
207
  ```
180
208
 
181
- ## Writing cookbooks
209
+ ## Writing configuration management code
182
210
 
183
- Since chake is actually a wrapper for Chef Solo, you should read the [chef
184
- documentation](https://docs.chef.io/). In special, look at the [Chef Solo
185
- Documentation](https://docs.chef.io/chef_solo.html).
211
+ As chake supports different configuration management tools, the specifics of
212
+ configuration management code depends on the the tool you choose. See the
213
+ corresponding documentation.
186
214
 
187
215
  ## The node bootstrapping process
188
216
 
189
- When chake acts on a node for the first time, it has to bootstrap it. The
190
- bootstrapping process includes doing the following:
217
+ Some of the configuration management tools require some software to be
218
+ installed on the managed hosts. When that's the case, chake acts on a node for
219
+ the first time, it has to bootstrap it. The bootstrapping process includes
220
+ doing the following:
191
221
 
192
- - installing chef and rsync
193
- - disabling the chef client daemon
222
+ - installing and configuring the needed software
194
223
  - setting up the hostname
195
224
 
196
225
  ## Node URLs
@@ -201,10 +230,10 @@ is the simplest form of specifying your nodes. Here are all the components of
201
230
  the node URLs:
202
231
 
203
232
  ```
204
- [backend://][username@]hostname[:port][/path]
233
+ [connection://][username@]hostname[:port][/path]
205
234
  ```
206
235
 
207
- * `backend`: backend to use to connect to the host. `ssh` or `local` (default: `ssh`)
236
+ * `connection`: what to use to connect to the host. `ssh` or `local` (default: `ssh`)
208
237
  * `username`: user name to connect with (default: the username on your local workstation)
209
238
  * `hostname`: the hostname to connect to (default: _none_)
210
239
  * `port`: port number to connect to (default: 22)
@@ -228,7 +257,7 @@ converging. To do this, you just need to enhance the corresponding tasks:
228
257
 
229
258
  Example:
230
259
 
231
- ```
260
+ ```ruby
232
261
  task :bootstrap_common do
233
262
  sh './scripts/pre-bootstrap-checks'
234
263
  end
@@ -237,10 +266,19 @@ end
237
266
  ### Encrypted files
238
267
 
239
268
  Any files ending matching `*.gpg` and `*.asc` will be decrypted with GnuPG
240
- before being sent to the node. You can use them to store passwords and other
269
+ before being sent to the node (for the configuration management tools that
270
+ required files to be sent). You can use them to store passwords and other
241
271
  sensitive information (SSL keys, etc) in the repository together with the rest
242
272
  of the configuration.
243
273
 
274
+ For configuration managers that don't require uploading files to the managed
275
+ node, this decryption will happen right before converging or applying single
276
+ recipes, and the decrypted files will be wiped right after that.
277
+
278
+ If you use this feature, make sure that you have the `wipe` program installed.
279
+ This way chake will be able to delete the decrypted files in a slightly more
280
+ secure way, after being done with them.
281
+
244
282
  ### repository-local SSH configuration
245
283
 
246
284
  If you need special SSH configuration parameters, you can create a file called
@@ -260,7 +298,7 @@ Some times, you will also want or need to prefix your SSH invocations with some
260
298
  prefix command in order to e.g. tunnel it through some central exit node. You
261
299
  can do this by setting `$CHAKE_SSH_PREFIX` on your environment. Example:
262
300
 
263
- ```
301
+ ```bash
264
302
  CHAKE_SSH_PREFIX=tsocks rake converge
265
303
  ```
266
304
 
@@ -269,28 +307,29 @@ The above will make all SSH invocations to all hosts be called as `tsocks ssh
269
307
 
270
308
  ### Converging local host
271
309
 
272
- If you want to manage your local workstation with chake, you can declare a local node like this in `nodes.yaml`:
310
+ If you want to manage your local workstation with chake, you can declare a
311
+ local node using the "local" connection type, like this (in `nodes.yaml`):
273
312
 
274
313
  ```yaml
275
314
  local://thunderbolt:
276
- run_list:
277
- - role[workstation]
315
+ itamae:
316
+ - role/workstation.rb
278
317
  ```
279
318
 
280
319
  To apply the configuration to the local host, you can use the conventional
281
320
  `rake converge:thunderbolt`, or the special target `rake local`.
282
321
 
283
322
  When converging all nodes, `chake` will skip nodes that are declared with the
284
- `local://` backend and whose hostname does not match the hostname in the
323
+ `local://` connection and whose hostname does not match the hostname in the
285
324
  declaration. For example:
286
325
 
287
326
  ```yaml
288
327
  local://desktop:
289
- run_list:
290
- - role[workstation]
328
+ itamae:
329
+ - role/workstation.rb
291
330
  local://laptop:
292
- run_list:
293
- - role[workstation]
331
+ itamae:
332
+ - role/workstation.rb
294
333
  ```
295
334
 
296
335
  When you run `rake converge` on `desktop`, `laptop` will be skipped, and
@@ -330,13 +369,7 @@ end
330
369
 
331
370
  ## See also
332
371
 
333
- * **rake(1)**, **chef-solo(1)**
334
- * Chef documentation: https://docs.chef.io/
335
-
336
- ## Contributing
337
-
338
- 1. Fork it ( http://github.com/terceiro/chake/fork )
339
- 2. Create your feature branch (`git checkout -b my-new-feature`)
340
- 3. Commit your changes (`git commit -am 'Add some feature'`)
341
- 4. Push to the branch (`git push origin my-new-feature`)
342
- 5. Create new Pull Request
372
+ * **rake(1)**
373
+ * **chake-itamae(7)**, https://itamae.kitchen/
374
+ * **chake-shell(7)**
375
+ * **chake-chef(7)**, **chef-solo(1)**, https://docs.chef.io/