cheftacular 2.13.0 → 2.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cheftacular/README.md +42 -6
- data/lib/cheftacular/actions/check.rb +5 -1
- data/lib/cheftacular/actions/console.rb +7 -1
- data/lib/cheftacular/actions/deploy.rb +5 -1
- data/lib/cheftacular/actions/migrate.rb +5 -1
- data/lib/cheftacular/actions/run.rb +10 -7
- data/lib/cheftacular/auditor.rb +48 -7
- data/lib/cheftacular/stateless_actions/client_list.rb +2 -2
- data/lib/cheftacular/stateless_actions/cloud_bootstrap.rb +5 -1
- data/lib/cheftacular/stateless_actions/environment.rb +6 -2
- data/lib/cheftacular/stateless_actions/file.rb +1 -1
- data/lib/cheftacular/stateless_actions/fix_known_hosts.rb +5 -1
- data/lib/cheftacular/stateless_actions/knife_upload.rb +5 -1
- data/lib/cheftacular/stateless_actions/location_aliases.rb +7 -1
- data/lib/cheftacular/stateless_actions/remove_client.rb +2 -1
- data/lib/cheftacular/stateless_actions/role_toggle.rb +5 -1
- data/lib/cheftacular/stateless_actions/update_cookbook.rb +5 -1
- data/lib/cheftacular/stateless_actions/upload_nodes.rb +5 -1
- data/lib/cheftacular/stateless_actions/upload_roles.rb +7 -1
- data/lib/cheftacular/stateless_actions/version.rb +6 -0
- data/lib/cheftacular/version.rb +1 -1
- data/lib/cloud_interactor/authentication.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92f2e70957d1d62c5599891b291c67693b3577de
|
4
|
+
data.tar.gz: c02911fd60f6acb0b49bc9ad3011a22caf57d90c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3153b70f011016ee0f051a9d423eab7042b2501e088e959701cf09600ab78c9a025b82474017b1a2d3505e19c63941fe202d40d0315881666362847edea0212d
|
7
|
+
data.tar.gz: ec88f2eaac833915e014a53fdd665d5748ab5ddb9da1228fce851889f91e8b38b01119af5afabecf79490d314d870096f1bd0d91a0567b412d0e0a17ed874fa1
|
data/lib/cheftacular/README.md
CHANGED
@@ -88,6 +88,8 @@
|
|
88
88
|
|
89
89
|
2. If the all argument is provided, all repositories will be checked for the current environment
|
90
90
|
|
91
|
+
3. Aliased to `cft ch`
|
92
|
+
|
91
93
|
3. `cft chef_server [restart|processes|memory]` this command can be used to query the chef server for stats if the cheftacular.yml has the chef_server key filled out. Useful for low resource chef-servers.
|
92
94
|
|
93
95
|
1. `restart` restarts all chef processes on the chef server which may alleviate slow cheftacular load times for some users. (NOTE) do not run this command while the chef-server is performing actions or instability may result! Not tested for high volume chef servers.
|
@@ -138,7 +140,7 @@
|
|
138
140
|
|
139
141
|
5. `-E|--search-env-name ENV_NAME` option will make this command return results that have this environment.
|
140
142
|
|
141
|
-
6. This command is aliased to `cft clients` and `cft
|
143
|
+
6. This command is aliased to `cft clients` and `cft cl`
|
142
144
|
|
143
145
|
9. `cft console` will create a console session on the first node found for a repository.
|
144
146
|
|
@@ -146,6 +148,8 @@
|
|
146
148
|
|
147
149
|
2. If there is a node in the repository set that has the role `preferred_console`, this node will come before others.
|
148
150
|
|
151
|
+
3. Aliased to `cft co`
|
152
|
+
|
149
153
|
10. `cft db_console` will create a database console session on the first node found for a database stack in the current environment.
|
150
154
|
|
151
155
|
1. This command is aliased to psql, typing `cft psql` will drop you into a rails stack database psql session.
|
@@ -164,6 +168,8 @@
|
|
164
168
|
|
165
169
|
5. The `-v|--verbose` option will cause failed deploys to output to the terminal window and to their normal log file. Useful for debugging.
|
166
170
|
|
171
|
+
6. Aliased to `cft d`
|
172
|
+
|
167
173
|
12. `cft disk_report` will fetch useful statistics from every server for every environment and output it into your log directory.
|
168
174
|
|
169
175
|
13. `cft environment boot|boot_without_deploy|destroy|destroy_raw_servers [SERVER_NAMES]` will boot / destroy the current environment
|
@@ -180,6 +186,8 @@
|
|
180
186
|
|
181
187
|
6. This command also accepts a *comma delimited list* of server names to boot / destroy instead of all the stored ones for an environment.
|
182
188
|
|
189
|
+
7. Aliased to `cft e`
|
190
|
+
|
183
191
|
14. `cft file NODE_NAME LOCATION_ALIAS MODE FILE_NAME` interacts with a file on the remote server
|
184
192
|
|
185
193
|
1. `LOCATION_ALIAS` will be parsed as a path if it has backslash characters. Otherwise it will be parsed from your location_aliases hash in your cheftacular.yml
|
@@ -196,7 +204,7 @@
|
|
196
204
|
|
197
205
|
3. `edit:TEXT_EDITOR` will attempt to edit the file with the TEXT_EDITOR listed. NOTE! This editor must be installed on the node you're accessing. If the editor is not present via a `which` command, the cft file command will say so.
|
198
206
|
|
199
|
-
4. `fetch|scp` will attempt to fetch the FILE_NAME listed via SCP. This file is saved to /Users/louis/Code/chef-repo/
|
207
|
+
4. `fetch|scp` will attempt to fetch the FILE_NAME listed via SCP. This file is saved to /Users/louis/Code/chef-repo/log (based on your directory structure) under the same FILE_NAME as the remote file.
|
200
208
|
|
201
209
|
1. The deploy must have access to said file without sudo!
|
202
210
|
|
@@ -214,6 +222,8 @@
|
|
214
222
|
|
215
223
|
1. Passing in a hostname will make the command only remove entries with that hostname / ip specifically
|
216
224
|
|
225
|
+
2. Aliased to `cft fkh`
|
226
|
+
|
217
227
|
16. `cft get_active_ssh_connections` will fetch the active ssh connections from every server and output it into your log directory.
|
218
228
|
|
219
229
|
1. This command runs on all servers in an environment by default
|
@@ -232,6 +242,8 @@
|
|
232
242
|
|
233
243
|
22. `cft location_aliases` will list all location aliases listed in your cheftacular.yml. These aliases can be used in the `cft file` command.
|
234
244
|
|
245
|
+
1. This command is aliased to `cft la`
|
246
|
+
|
235
247
|
23. `cft log` this command will output the last 500 lines of logs from every server set for the repository (can be given additional args to specify) to the log directory
|
236
248
|
|
237
249
|
1. `--nginx` will fetch the nginx logs as well as the application logs
|
@@ -262,6 +274,8 @@
|
|
262
274
|
|
263
275
|
1. Please run `cft list_toggleable_roles NODE_NAME` to get a list of your org's toggleable roles for a node.
|
264
276
|
|
277
|
+
4. Aliased to `cft rt`
|
278
|
+
|
265
279
|
27. `cft run COMMAND [--all]` will trigger the command on the first server in the role. Can be used to run rake commands or anything else.
|
266
280
|
|
267
281
|
1. `--all` will make the command run against all servers in a role rather than the first server it comes across. Don't do this if you're modifying the database with the command.
|
@@ -288,6 +302,8 @@
|
|
288
302
|
|
289
303
|
31. `cft version` this command prints out the current version of cheftacular.
|
290
304
|
|
305
|
+
1. Aliased to `cft v`
|
306
|
+
|
291
307
|
|
292
308
|
## Commands that can ONLY be run in the devops context
|
293
309
|
|
@@ -371,7 +387,7 @@
|
|
371
387
|
|
372
388
|
5. `-E|--search-env-name ENV_NAME` option will make this command return results that have this environment.
|
373
389
|
|
374
|
-
6. This command is aliased to `cft clients` and `cft
|
390
|
+
6. This command is aliased to `cft clients` and `cft cl`
|
375
391
|
|
376
392
|
13. `cft cloud <FIRST_LEVEL_ARG> [<SECOND_LEVEL_ARG>[:<SECOND_LEVEL_ARG_QUERY>]*] ` this command handles talking to various cloud APIs. If no args are passed nothing will happen.
|
377
393
|
|
@@ -479,6 +495,8 @@
|
|
479
495
|
|
480
496
|
4. DESCRIPTOR is used as an internal tag for the node, if left blank it will become the name of the node. It is recommended to enter a custom repository-dependent tag here to make nodes easier to load-balance like "lb:[CODEBASE_NAME]"
|
481
497
|
|
498
|
+
5. Aliased to `cft cb`
|
499
|
+
|
482
500
|
15. `cft cloud_bootstrap_from_queue` uses a cloud api to create several servers. It is a wrapper around the cloud_bootstrap command that tries to queue server creation.
|
483
501
|
|
484
502
|
1. This command cannot be called directly and can only be utilized from `cft environment boot`
|
@@ -511,6 +529,8 @@
|
|
511
529
|
|
512
530
|
6. This command also accepts a *comma delimited list* of server names to boot / destroy instead of all the stored ones for an environment.
|
513
531
|
|
532
|
+
7. Aliased to `cft e`
|
533
|
+
|
514
534
|
21. `cft file NODE_NAME LOCATION_ALIAS MODE FILE_NAME` interacts with a file on the remote server
|
515
535
|
|
516
536
|
1. `LOCATION_ALIAS` will be parsed as a path if it has backslash characters. Otherwise it will be parsed from your location_aliases hash in your cheftacular.yml
|
@@ -527,7 +547,7 @@
|
|
527
547
|
|
528
548
|
3. `edit:TEXT_EDITOR` will attempt to edit the file with the TEXT_EDITOR listed. NOTE! This editor must be installed on the node you're accessing. If the editor is not present via a `which` command, the cft file command will say so.
|
529
549
|
|
530
|
-
4. `fetch|scp` will attempt to fetch the FILE_NAME listed via SCP. This file is saved to /Users/louis/Code/chef-repo/
|
550
|
+
4. `fetch|scp` will attempt to fetch the FILE_NAME listed via SCP. This file is saved to /Users/louis/Code/chef-repo/log (based on your directory structure) under the same FILE_NAME as the remote file.
|
531
551
|
|
532
552
|
1. The deploy must have access to said file without sudo!
|
533
553
|
|
@@ -545,6 +565,8 @@
|
|
545
565
|
|
546
566
|
1. Passing in a hostname will make the command only remove entries with that hostname / ip specifically
|
547
567
|
|
568
|
+
2. Aliased to `cft fkh`
|
569
|
+
|
548
570
|
23. `cft full_bootstrap_from_queue` This command performs both ubuntu_bootstrap and chef_bootstrap.
|
549
571
|
|
550
572
|
1. This command is run by `cft cloud_bootstrap` and should not be run on its own.
|
@@ -577,10 +599,14 @@
|
|
577
599
|
|
578
600
|
2. Utilize `knife cookbook upload -a -V --cookbook-path ./cookbooks` if this command gives you trouble
|
579
601
|
|
602
|
+
3. Aliased to `cft ku`
|
603
|
+
|
580
604
|
32. `cft list_toggleable_roles NODE_NAME` This command will allow you to see all toggleable roles for a node
|
581
605
|
|
582
606
|
33. `cft location_aliases` will list all location aliases listed in your cheftacular.yml. These aliases can be used in the `cft file` command.
|
583
607
|
|
608
|
+
1. This command is aliased to `cft la`
|
609
|
+
|
584
610
|
34. `cft pass NODE_NAME` will drop the server's sudo password into your clipboard. Useful for when you need to ssh into the server itself and try advanced linux commands
|
585
611
|
|
586
612
|
35. `cft reinitialize IP_ADDRESS NODE_NAME` will reconnect a server previously managed by chef to a new chef server. The node name MUST MATCH THE NODE'S ORIGINAL NODE NAME for the roles to be setup correctly.
|
@@ -589,7 +615,7 @@
|
|
589
615
|
|
590
616
|
1. `destroy` deletes the server as well as removing it from the chef environment.
|
591
617
|
|
592
|
-
2. This command is aliased to `cft remove_node`
|
618
|
+
2. This command is aliased to `cft remove_node` and `cft rc`
|
593
619
|
|
594
620
|
37. `cft replication_status` will check the status of the database master and slaves in every environment. Also lists how far behind the slaves are from the master in milliseconds.
|
595
621
|
|
@@ -611,6 +637,8 @@
|
|
611
637
|
|
612
638
|
1. Please run `cft list_toggleable_roles NODE_NAME` to get a list of your org's toggleable roles for a node.
|
613
639
|
|
640
|
+
4. Aliased to `cft rt`
|
641
|
+
|
614
642
|
41. `cft rvm [COMMAND] [ADDITIONAL_COMMANDS]*` will run rvm commands on the remote servers. Output from this command for each server will go into your rvm directory under the log directory. Please refer to [the rvm help page](https://rvm.io/rvm) for more information on rvm commands.
|
615
643
|
|
616
644
|
1. When no commands are passed, rvm will just run `rvm list` on each server on all servers in the current environment.
|
@@ -671,6 +699,8 @@
|
|
671
699
|
|
672
700
|
1. This command passed with no arguments will update TheCheftacularCookbook
|
673
701
|
|
702
|
+
2. Aliased to `cft uc`
|
703
|
+
|
674
704
|
50. `cft update_split_branches` will perform a series of git commands that will merge all the split branches for your split_branch enabled repositories with what is currently on master and push them.
|
675
705
|
|
676
706
|
1. Repository must be set with `-R REPOSITORY_NAME` for this command to work.
|
@@ -695,6 +725,12 @@
|
|
695
725
|
|
696
726
|
1. Due to this, only users running this against their chef-repo need to worry about having a nodes_dir, the way it should be.
|
697
727
|
|
728
|
+
4. Aliased to `cft un`
|
729
|
+
|
698
730
|
53. `cft upload_roles` This command will resync the chef server's roles with the data in the chef-repo/roles.
|
699
731
|
|
700
|
-
|
732
|
+
1. Aliased to `cft ur`
|
733
|
+
|
734
|
+
54. `cft version` this command prints out the current version of cheftacular.
|
735
|
+
|
736
|
+
1. Aliased to `cft v`
|
@@ -9,7 +9,9 @@ class Cheftacular
|
|
9
9
|
" 1. If the node has special repository based keys from TheCheftacularCookbook, this command will also display information " +
|
10
10
|
"about the branch and organization currently deployed to the node(s).",
|
11
11
|
|
12
|
-
" 2. If the all argument is provided, all repositories will be checked for the current environment"
|
12
|
+
" 2. If the all argument is provided, all repositories will be checked for the current environment",
|
13
|
+
|
14
|
+
" 3. Aliased to `cft ch`"
|
13
15
|
]
|
14
16
|
]
|
15
17
|
@config['documentation']['action'][__method__]['short_description'] = "Checks the branches currently deployed to an env for your repo"
|
@@ -85,6 +87,8 @@ class Cheftacular
|
|
85
87
|
end
|
86
88
|
end
|
87
89
|
end
|
90
|
+
|
91
|
+
alias_method :ch, :check
|
88
92
|
end
|
89
93
|
end
|
90
94
|
|
@@ -7,7 +7,9 @@ class Cheftacular
|
|
7
7
|
[
|
8
8
|
" 1. Attempts to setup a console for the unique stack, stacks currently supported for console is only Rails.",
|
9
9
|
|
10
|
-
" 2. If there is a node in the repository set that has the role `preferred_console`, this node will come before others."
|
10
|
+
" 2. If there is a node in the repository set that has the role `preferred_console`, this node will come before others.",
|
11
|
+
|
12
|
+
" 3. Aliased to `cft co`"
|
11
13
|
]
|
12
14
|
]
|
13
15
|
|
@@ -18,6 +20,8 @@ class Cheftacular
|
|
18
20
|
class Action
|
19
21
|
def console
|
20
22
|
self.send("console_#{ @config['getter'].get_current_stack }")
|
23
|
+
|
24
|
+
@config['auditor'].notify_slack_on_completion("console run completed\n") if @config['cheftacular']['auditing']
|
21
25
|
end
|
22
26
|
|
23
27
|
def console_ruby_on_rails node_args=[{unless: 'role[rails]'}]
|
@@ -76,5 +80,7 @@ class Cheftacular
|
|
76
80
|
|
77
81
|
return false
|
78
82
|
end
|
83
|
+
|
84
|
+
alias_method :co, :console
|
79
85
|
end
|
80
86
|
end
|
@@ -17,7 +17,9 @@ class Cheftacular
|
|
17
17
|
" 4. This command will also run migrations on both an role's normal servers and its split servers if certain " +
|
18
18
|
"conditions are met (such as the role having a database, etc).",
|
19
19
|
|
20
|
-
" 5. The `-v|--verbose` option will cause failed deploys to output to the terminal window and to their normal log file. Useful for debugging."
|
20
|
+
" 5. The `-v|--verbose` option will cause failed deploys to output to the terminal window and to their normal log file. Useful for debugging.",
|
21
|
+
|
22
|
+
" 6. Aliased to `cft d`"
|
21
23
|
]
|
22
24
|
]
|
23
25
|
|
@@ -77,6 +79,8 @@ class Cheftacular
|
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
82
|
+
|
83
|
+
alias_method :d, :deploy
|
80
84
|
end
|
81
85
|
end
|
82
86
|
|
@@ -48,7 +48,11 @@ class Cheftacular
|
|
48
48
|
@options['run_migration_already'] = true
|
49
49
|
|
50
50
|
#restart the servers again after a deploy with a migration just in case
|
51
|
-
|
51
|
+
if !log_data.empty? && log_data != @config['cheftacular']['repositories'][@options['role']]['not_a_migration_message']
|
52
|
+
@config['auditor'].notify_slack_on_completion("migrate run completed\n") if @config['cheftacular']['auditing']
|
53
|
+
|
54
|
+
deploy
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
def migrate_wordpress nodes=[]
|
@@ -26,12 +26,15 @@ class Cheftacular
|
|
26
26
|
|
27
27
|
class Action
|
28
28
|
def run
|
29
|
-
|
29
|
+
command = @config['parser'].parse_runtime_arguments 0, 'range'
|
30
|
+
|
31
|
+
self.send("run_#{ @config['getter'].get_current_stack }", command)
|
32
|
+
|
33
|
+
@config['auditor'].notify_slack_on_completion("run #{ command } completed\n") if @config['cheftacular']['auditing']
|
30
34
|
end
|
31
35
|
|
32
|
-
def run_ruby_on_rails
|
36
|
+
def run_ruby_on_rails command
|
33
37
|
nodes = @config['getter'].get_true_node_objects
|
34
|
-
command = @config['parser'].parse_runtime_arguments 0, 'range'
|
35
38
|
|
36
39
|
#must have rails stack to run migrations and not be a db, only want ONE node
|
37
40
|
nodes = @config['parser'].exclude_nodes( nodes, [{ unless: "role[#{ @options['role'] }]" }], !@options['run_on_all'] )
|
@@ -56,19 +59,19 @@ class Cheftacular
|
|
56
59
|
@config['helper'].send_log_bag_hash_slack_notification(logs_bag_hash, __method__, 'Failing command detected, exiting...')
|
57
60
|
end
|
58
61
|
|
59
|
-
def run_nodejs
|
62
|
+
def run_nodejs command
|
60
63
|
raise "Not yet implemented"
|
61
64
|
end
|
62
65
|
|
63
|
-
def run_wordpress
|
66
|
+
def run_wordpress command
|
64
67
|
raise "Not yet implemented"
|
65
68
|
end
|
66
69
|
|
67
|
-
def run_all
|
70
|
+
def run_all command
|
68
71
|
raise "You attempted to run a command for the all role, this is not possible."
|
69
72
|
end
|
70
73
|
|
71
|
-
def run_
|
74
|
+
def run_ command
|
72
75
|
puts "Run method tried to run a command for the role \"#{ @options['role'] }\" but it doesn't appear to have a repository set! Skipping..."
|
73
76
|
|
74
77
|
return false
|
data/lib/cheftacular/auditor.rb
CHANGED
@@ -24,7 +24,7 @@ class Cheftacular
|
|
24
24
|
ret_hash['hostname'] = Socket.gethostname
|
25
25
|
ret_hash['directory'] = @config['locs']['root']
|
26
26
|
ret_hash['version'] = Cheftacular::VERSION
|
27
|
-
ret_hash['command'] = @options['command']
|
27
|
+
ret_hash['command'] = return_true_command(@options['command'])
|
28
28
|
|
29
29
|
options_to_ignore << :preferred_cloud if @options['preferred_cloud'] == @config['cheftacular']['preferred_cloud']
|
30
30
|
options_to_ignore << :preferred_cloud_image if @options['preferred_cloud_image'] == @config['cheftacular']['preferred_cloud_image']
|
@@ -41,26 +41,67 @@ class Cheftacular
|
|
41
41
|
ret_hash
|
42
42
|
end
|
43
43
|
|
44
|
-
def compile_audit_hash_entry_as_array audit_hash, entry_number=0, ret_array=[], directory_content='', version_content=''
|
44
|
+
def compile_audit_hash_entry_as_array audit_hash, entry_number=0, mode='normal', ret_array=[], directory_content='', version_content=''
|
45
45
|
directory_content = " (#{ audit_hash['directory'] })" if audit_hash.has_key?('directory')
|
46
46
|
version_content = " [#{ audit_hash['version'] }]" if audit_hash.has_key?('version')
|
47
47
|
|
48
|
-
ret_array << "#{ (entry_number.to_s + '. ') unless entry_number == 0 }#{ audit_hash['command'] }"
|
48
|
+
ret_array << "#{ (entry_number.to_s + '. ') unless entry_number == 0 }#{ audit_hash['command'] }" if mode =~ /normal/
|
49
49
|
ret_array << " Hostname: #{ audit_hash['hostname'] }#{ directory_content }#{ version_content }"
|
50
|
-
|
51
|
-
|
50
|
+
|
51
|
+
if mode =~ /normal/
|
52
|
+
ret_array << " Arguments: #{ audit_hash['arguments'] }" if !audit_hash['arguments'].nil? && !audit_hash['arguments'].empty?
|
53
|
+
ret_array << " Options: #{ audit_hash['options'].to_hash }" unless audit_hash['options'].empty?
|
54
|
+
end
|
52
55
|
|
53
56
|
ret_array = ret_array.map { |entry| entry.prepend(' ')} unless entry_number == 0
|
54
57
|
|
55
58
|
ret_array
|
56
59
|
end
|
57
60
|
|
61
|
+
def notify_slack_on_completion msg
|
62
|
+
audit_command_to_slack_queue(audit_run_as_hash, 'short', msg)
|
63
|
+
end
|
64
|
+
|
65
|
+
def return_true_command command
|
66
|
+
final_command = command
|
67
|
+
|
68
|
+
if aliased_command_hash.values.flatten.include?(command)
|
69
|
+
aliased_command_hash.each_pair do |full_command, alias_array|
|
70
|
+
|
71
|
+
final_command = full_command if alias_array.include?(command)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
final_command
|
76
|
+
end
|
77
|
+
|
58
78
|
private
|
59
79
|
|
60
|
-
def audit_command_to_slack_queue audit_hash, msg=''
|
61
|
-
msg << compile_audit_hash_entry_as_array(audit_hash).join("\n")
|
80
|
+
def audit_command_to_slack_queue audit_hash, mode='normal', msg=''
|
81
|
+
msg << compile_audit_hash_entry_as_array(audit_hash, 0, mode).join("\n")
|
62
82
|
|
63
83
|
@config['slack_queue'] << { message: msg.prepend('```').insert(-1, '```'), channel: @config['cheftacular']['slack']['notify_on_command_execute'] }
|
64
84
|
end
|
85
|
+
|
86
|
+
def aliased_command_hash
|
87
|
+
{
|
88
|
+
check: ['ch'],
|
89
|
+
console: ['co'],
|
90
|
+
deploy: ['d'],
|
91
|
+
cheftacular_config: ['cc'],
|
92
|
+
cheftacular_yml_help: ['yml_help'],
|
93
|
+
client_list: ['cl'],
|
94
|
+
environment: ['e'],
|
95
|
+
fix_known_hosts: ['fkh'],
|
96
|
+
knife_upload: ['ku'],
|
97
|
+
location_aliases: ['la'],
|
98
|
+
remove_client: ['rc'],
|
99
|
+
role_toggle: ['rt'],
|
100
|
+
update_cookbook: ['uc'],
|
101
|
+
upload_nodes: ['un'],
|
102
|
+
upload_roles: ['ur'],
|
103
|
+
version: ['v']
|
104
|
+
}
|
105
|
+
end
|
65
106
|
end
|
66
107
|
end
|
@@ -20,7 +20,7 @@ class Cheftacular
|
|
20
20
|
|
21
21
|
" 5. `-E|--search-env-name ENV_NAME` option will make this command return results that have this environment.",
|
22
22
|
|
23
|
-
" 6. This command is aliased to `cft clients` and `cft
|
23
|
+
" 6. This command is aliased to `cft clients` and `cft cl`"
|
24
24
|
]
|
25
25
|
]
|
26
26
|
|
@@ -100,6 +100,6 @@ class Cheftacular
|
|
100
100
|
end
|
101
101
|
|
102
102
|
alias_method :clients, :client_list
|
103
|
-
alias_method :
|
103
|
+
alias_method :cl, :client_list
|
104
104
|
end
|
105
105
|
end
|
@@ -19,7 +19,9 @@ class Cheftacular
|
|
19
19
|
"will match \"1GB Standard\" (for rackspace flavors)",
|
20
20
|
|
21
21
|
" 4. DESCRIPTOR is used as an internal tag for the node, if left blank it will become the name of the node. " +
|
22
|
-
"It is recommended to enter a custom repository-dependent tag here to make nodes easier to load-balance like \"lb:[CODEBASE_NAME]\""
|
22
|
+
"It is recommended to enter a custom repository-dependent tag here to make nodes easier to load-balance like \"lb:[CODEBASE_NAME]\"",
|
23
|
+
|
24
|
+
" 5. Aliased to `cft cb`"
|
23
25
|
]
|
24
26
|
]
|
25
27
|
|
@@ -79,5 +81,7 @@ class Cheftacular
|
|
79
81
|
|
80
82
|
@config['stateless_action'].full_bootstrap_from_queue unless @config['in_server_creation_queue'] #bootstrap server with ruby and attach it to the chef server
|
81
83
|
end
|
84
|
+
|
85
|
+
alias_method :cb, :cloud_bootstrap
|
82
86
|
end
|
83
87
|
end
|
@@ -19,7 +19,9 @@ class Cheftacular
|
|
19
19
|
" 5. This command will prompt when attempting to destroy servers in staging or production. " +
|
20
20
|
"Additionally, only devops clients will be able to destroy servers in those environments.",
|
21
21
|
|
22
|
-
" 6. This command also accepts a *comma delimited list* of server names to boot / destroy instead of all the stored ones for an environment."
|
22
|
+
" 6. This command also accepts a *comma delimited list* of server names to boot / destroy instead of all the stored ones for an environment.",
|
23
|
+
|
24
|
+
" 7. Aliased to `cft e`"
|
23
25
|
]
|
24
26
|
]
|
25
27
|
|
@@ -137,9 +139,11 @@ class Cheftacular
|
|
137
139
|
|
138
140
|
sleep 15
|
139
141
|
end
|
140
|
-
end
|
142
|
+
end
|
141
143
|
end
|
142
144
|
|
145
|
+
alias_method :e, :environment
|
146
|
+
|
143
147
|
private
|
144
148
|
|
145
149
|
def environment_is_destroyable?
|
@@ -23,7 +23,7 @@ class Cheftacular
|
|
23
23
|
" 3. `edit:TEXT_EDITOR` will attempt to edit the file with the TEXT_EDITOR listed. NOTE! This editor must be installed " +
|
24
24
|
"on the node you're accessing. If the editor is not present via a `which` command, the cft file command will say so.",
|
25
25
|
|
26
|
-
" 4. `fetch|scp` will attempt to fetch the FILE_NAME listed via SCP. This file is saved to #{ @config['locs']['
|
26
|
+
" 4. `fetch|scp` will attempt to fetch the FILE_NAME listed via SCP. This file is saved to #{ @config['locs']['chef-log'] } " +
|
27
27
|
"(based on your directory structure) under the same FILE_NAME as the remote file.",
|
28
28
|
|
29
29
|
" 1. The #{ @config['cheftacular']['deploy_user'] } must have access to said file without sudo!",
|
@@ -8,7 +8,9 @@ class Cheftacular
|
|
8
8
|
"for all the servers that are in our system (ip addresses AND dns names)",
|
9
9
|
|
10
10
|
[
|
11
|
-
" 1. Passing in a hostname will make the command only remove entries with that hostname / ip specifically"
|
11
|
+
" 1. Passing in a hostname will make the command only remove entries with that hostname / ip specifically",
|
12
|
+
|
13
|
+
" 2. Aliased to `cft fkh`"
|
12
14
|
]
|
13
15
|
]
|
14
16
|
|
@@ -48,5 +50,7 @@ class Cheftacular
|
|
48
50
|
@config['filesystem'].scrub_from_known_hosts target
|
49
51
|
end
|
50
52
|
end
|
53
|
+
|
54
|
+
alias_method :fkh, :fix_known_hosts
|
51
55
|
end
|
52
56
|
end
|
@@ -10,7 +10,9 @@ class Cheftacular
|
|
10
10
|
[
|
11
11
|
" 1. The force option will add the force option to knife upload.",
|
12
12
|
|
13
|
-
" 2. Utilize `knife cookbook upload -a -V --cookbook-path ./cookbooks` if this command gives you trouble"
|
13
|
+
" 2. Utilize `knife cookbook upload -a -V --cookbook-path ./cookbooks` if this command gives you trouble",
|
14
|
+
|
15
|
+
" 3. Aliased to `cft ku`"
|
14
16
|
]
|
15
17
|
]
|
16
18
|
|
@@ -35,5 +37,7 @@ class Cheftacular
|
|
35
37
|
|
36
38
|
puts out
|
37
39
|
end
|
40
|
+
|
41
|
+
alias_method :ku, :knife_upload
|
38
42
|
end
|
39
43
|
end
|
@@ -4,7 +4,11 @@ class Cheftacular
|
|
4
4
|
@config['documentation']['stateless_action'][__method__] ||= {}
|
5
5
|
@config['documentation']['stateless_action'][__method__]['long_description'] = [
|
6
6
|
"`cft location_aliases` will list all location aliases listed in your cheftacular.yml. These aliases can be used " +
|
7
|
-
"in the `cft file` command."
|
7
|
+
"in the `cft file` command.",
|
8
|
+
|
9
|
+
[
|
10
|
+
" 1. This command is aliased to `cft la`"
|
11
|
+
]
|
8
12
|
]
|
9
13
|
|
10
14
|
@config['documentation']['stateless_action'][__method__]['short_description'] = 'Checks your location aliases that can be used with the cft file command'
|
@@ -23,5 +27,7 @@ class Cheftacular
|
|
23
27
|
def location_aliases
|
24
28
|
ap @config['cheftacular']['location_aliases']
|
25
29
|
end
|
30
|
+
|
31
|
+
alias_method :la, :location_aliases
|
26
32
|
end
|
27
33
|
end
|
@@ -12,7 +12,7 @@ class Cheftacular
|
|
12
12
|
[
|
13
13
|
" 1. `destroy` deletes the server as well as removing it from the chef environment.",
|
14
14
|
|
15
|
-
" 2. This command is aliased to `cft remove_node`"
|
15
|
+
" 2. This command is aliased to `cft remove_node` and `cft rc`"
|
16
16
|
]
|
17
17
|
]
|
18
18
|
|
@@ -74,5 +74,6 @@ class Cheftacular
|
|
74
74
|
end
|
75
75
|
|
76
76
|
alias_method :remove_node, :remove_client
|
77
|
+
alias_method :rc, :remove_client
|
77
78
|
end
|
78
79
|
end
|
@@ -25,7 +25,9 @@ class Cheftacular
|
|
25
25
|
" 3. In case it isn't obvious, this command ONLY supports deactivation suffix roles like worker_deactivate or worker_off, with their" +
|
26
26
|
"on counterpart just being the role itself, like \"worker\".",
|
27
27
|
|
28
|
-
" 1. Please run `cft list_toggleable_roles NODE_NAME` to get a list of your org's toggleable roles for a node."
|
28
|
+
" 1. Please run `cft list_toggleable_roles NODE_NAME` to get a list of your org's toggleable roles for a node.",
|
29
|
+
|
30
|
+
" 4. Aliased to `cft rt`"
|
29
31
|
]
|
30
32
|
]
|
31
33
|
|
@@ -144,5 +146,7 @@ class Cheftacular
|
|
144
146
|
@config['action'].deploy
|
145
147
|
end
|
146
148
|
end
|
149
|
+
|
150
|
+
alias_method :rt, :role_toggle
|
147
151
|
end
|
148
152
|
end
|
@@ -7,7 +7,9 @@ class Cheftacular
|
|
7
7
|
"`cft update_cookbook [COOKBOOK_NAME] [INSTALL_VERSION]` allows you to specifically update a single cookbook",
|
8
8
|
|
9
9
|
[
|
10
|
-
" 1. This command passed with no arguments will update TheCheftacularCookbook"
|
10
|
+
" 1. This command passed with no arguments will update TheCheftacularCookbook",
|
11
|
+
|
12
|
+
" 2. Aliased to `cft uc`"
|
11
13
|
]
|
12
14
|
]
|
13
15
|
|
@@ -41,5 +43,7 @@ class Cheftacular
|
|
41
43
|
break
|
42
44
|
end
|
43
45
|
end
|
46
|
+
|
47
|
+
alias_method :uc, :update_cookbook
|
44
48
|
end
|
45
49
|
end
|
@@ -18,7 +18,9 @@ class Cheftacular
|
|
18
18
|
" 3. When building new servers *in any mode*, this command will check the node_roles stored in the data bag only and update the " +
|
19
19
|
"run lists of the nodes from that data, NOT from the node_roles data stored on disk in the nodes_dir.",
|
20
20
|
|
21
|
-
" 1. Due to this, only users running this against their chef-repo need to worry about having a nodes_dir, the way it should be."
|
21
|
+
" 1. Due to this, only users running this against their chef-repo need to worry about having a nodes_dir, the way it should be.",
|
22
|
+
|
23
|
+
" 4. Aliased to `cft un`"
|
22
24
|
]
|
23
25
|
]
|
24
26
|
|
@@ -133,5 +135,7 @@ class Cheftacular
|
|
133
135
|
|
134
136
|
@config['filesystem'].cleanup_file_caches('current-nodes') if invalidate_file_node_cache
|
135
137
|
end
|
138
|
+
|
139
|
+
alias_method :un, :upload_nodes
|
136
140
|
end
|
137
141
|
end
|
@@ -4,7 +4,11 @@ class Cheftacular
|
|
4
4
|
def upload_roles
|
5
5
|
@config['documentation']['stateless_action'][__method__] ||= {}
|
6
6
|
@config['documentation']['stateless_action'][__method__]['long_description'] = [
|
7
|
-
"`cft upload_roles` This command will resync the chef server's roles with the data in the chef-repo/roles."
|
7
|
+
"`cft upload_roles` This command will resync the chef server's roles with the data in the chef-repo/roles.",
|
8
|
+
|
9
|
+
[
|
10
|
+
" 1. Aliased to `cft ur`"
|
11
|
+
]
|
8
12
|
]
|
9
13
|
|
10
14
|
@config['documentation']['stateless_action'][__method__]['short_description'] = 'Updates all roles based on data in your roles dir'
|
@@ -23,5 +27,7 @@ class Cheftacular
|
|
23
27
|
puts `knife role from file "#{ @config['locs']['roles'] }/#{ rd }"`
|
24
28
|
end
|
25
29
|
end
|
30
|
+
|
31
|
+
alias_method :ur, :upload_roles
|
26
32
|
end
|
27
33
|
end
|
@@ -5,6 +5,10 @@ class Cheftacular
|
|
5
5
|
@config['documentation']['stateless_action'][__method__] ||= {}
|
6
6
|
@config['documentation']['stateless_action'][__method__]['long_description'] = [
|
7
7
|
"`cft version` this command prints out the current version of cheftacular.",
|
8
|
+
|
9
|
+
[
|
10
|
+
" 1. Aliased to `cft v`"
|
11
|
+
]
|
8
12
|
]
|
9
13
|
|
10
14
|
@config['documentation']['stateless_action'][__method__]['short_description'] = 'Displays the current version of cheftacular'
|
@@ -23,5 +27,7 @@ class Cheftacular
|
|
23
27
|
def version
|
24
28
|
@config['helper'].display_currently_installed_version
|
25
29
|
end
|
30
|
+
|
31
|
+
alias_method :v, :version
|
26
32
|
end
|
27
33
|
end
|
data/lib/cheftacular/version.rb
CHANGED
@@ -52,6 +52,13 @@ class CloudInteractor
|
|
52
52
|
|
53
53
|
def parse_cloud_hash
|
54
54
|
case @options['preferred_cloud']
|
55
|
+
when 'aws'
|
56
|
+
{
|
57
|
+
provider: 'AWS',
|
58
|
+
aws_access_key_id: @auth_hash['cloud_authentication'][@options['preferred_cloud']]['access_key'],
|
59
|
+
aws_secret_access_key: @auth_hash['cloud_authentication'][@options['preferred_cloud']]['secret_access_key'],
|
60
|
+
region: @options['preferred_cloud_region']
|
61
|
+
}
|
55
62
|
when 'rackspace'
|
56
63
|
{
|
57
64
|
provider: 'Rackspace',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheftacular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.13.
|
4
|
+
version: 2.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis Alridge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|