cheftacular 2.15.3 → 2.15.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca73f1c5b5983aa8a6c458af1b3dca0cfce09d1b
4
- data.tar.gz: 53377d874c956a367e8fb60ee0c78430b535ea62
3
+ metadata.gz: d014299917c5a75ba2f9e5699bdbb23472bbeee4
4
+ data.tar.gz: 59b2d41808fc55ee2fb653160a36965c70f6c6cd
5
5
  SHA512:
6
- metadata.gz: 49e6ccedb14b9b42b96c1f269b45220c0249a4fabe9d440dd871b782d29ba9d78b83c8bf968c8da474b7c5df07db89c7a32625d699986008ab16e56cae66b62d
7
- data.tar.gz: 79d8c50bff33e56277018e7a5b5ca4fc68ab73ecbe5beea639e01a7690291c78effd316ca49e9eda4703a6cd78c41d852a9c7b708a8e056b8f898596c1510c78
6
+ metadata.gz: 6503c54bb272ed7db10154d0de453ea7bbf9d12a1673170921a66f7b95de3d50701151f92748b3ecb728e53e254530f3a9b3a71717e4dbe2c3da7af531b61c3d
7
+ data.tar.gz: f6264b1f3c31ef1b61fd4af27b1ea3ff7ea50623171207dc19031d157b1d42dc595c9c1c6d02d4d1bcb92ee61f322716c82faaa376dcf4f64e6f77a8dce22d25
@@ -67,10 +67,30 @@
67
67
 
68
68
  3. The `-z|--unset-github-deploy-args` option will clear your current `-Z` and `-O` flags.
69
69
 
70
+ 5. `--nginx` will fetch logs for various logging commands from nginx instead of the default location.
71
+
70
72
 
71
73
  ## Commands that can be run in the application context
72
74
 
73
- 1. `cft backups [activate|deactivate|fetch|load|restore]` this command sets the fetch_backups and restore_backups flags in your config data bag for an environment. These can be used to give application developers a way to trigger / untrigger restores in an environment
75
+ 1. `cft application boot|boot_without_deploy|destroy|destroy_raw_servers [SERVER_NAMES]` will boot / destroy the servers for current repository you are connected to
76
+
77
+ 1. `boot` will spin up servers and bring them to a stable state. This includes setting up their subdomains for the target environment.
78
+
79
+ 2. `destroy` will destroy all servers needed for the target environment
80
+
81
+ 3. `destroy_raw_servers` will destroy the servers without destroying the node data.
82
+
83
+ 4. `boot_without_deploy` will spin up servers and bring them to a state where they are ready to be deployed
84
+
85
+ 5. This command will prompt when attempting to destroy servers in staging or production. Additionally, only devops clients will be able to destroy servers in those environments.
86
+
87
+ 6. This command also accepts a *comma delimited list* of server names to boot / destroy instead of all the stored ones for an environment.
88
+
89
+ 7. This command works with all the flags that `cft deploy` works with, like -Z -z -O and so on.
90
+
91
+ 8. Aliased to `cft a` and `cft app`
92
+
93
+ 2. `cft backups [activate|deactivate|fetch|load|restore]` this command sets the fetch_backups and restore_backups flags in your config data bag for an environment. These can be used to give application developers a way to trigger / untrigger restores in an environment
74
94
 
75
95
  1. `activate` will turn on automated backup running (turns on the flag for the env in the config bag).
76
96
 
@@ -86,7 +106,7 @@
86
106
 
87
107
  6. By default, the backups command will use the context of your current environment to trigger backup related commands.
88
108
 
89
- 2. `cft check [all|verify]` Checks the commits for all servers for a repository (for an environment) and returns them in a simple chart. Also shows when these commits were deployed to the server.
109
+ 3. `cft check [all|verify]` Checks the commits for all servers for a repository (for an environment) and returns them in a simple chart. Also shows when these commits were deployed to the server.
90
110
 
91
111
  1. If the node has special repository based keys from TheCheftacularCookbook, this command will also display information about the branch and organization currently deployed to the node(s).
92
112
 
@@ -96,7 +116,7 @@
96
116
 
97
117
  4. Aliased to `cft ch`
98
118
 
99
- 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.
119
+ 4. `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.
100
120
 
101
121
  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.
102
122
 
@@ -108,7 +128,7 @@
108
128
 
109
129
  5. NOTE 2! Cheftacular does not (and will not) support accessing your chef server over ssh with password auth. If you have done this, you should feel bad and immediately switch ssh access to key authentication...
110
130
 
111
- 4. `cft cheftacular_config [diff|display|sync|overwrite]` this command Allows you to interact with your complete cheftacular configuration, the union of all repository's cheftacular.ymls.
131
+ 5. `cft cheftacular_config [diff|display|sync|overwrite]` this command Allows you to interact with your complete cheftacular configuration, the union of all repository's cheftacular.ymls.
112
132
 
113
133
  1. `display` will show the current overall configuration for cheftacular.
114
134
 
@@ -118,23 +138,23 @@
118
138
 
119
139
  4. This command is aliased to `cc`
120
140
 
121
- 5. `cft cheftacular_yml_help KEY` this commandallows you to get help on the meaning of each key in your cheftacular.yml overall config.
141
+ 6. `cft cheftacular_yml_help KEY` this commandallows you to get help on the meaning of each key in your cheftacular.yml overall config.
122
142
 
123
143
  1. This command can also by run with `cft yaml_help`.
124
144
 
125
145
  2. To examine nested keys, you can use colons inbetween the keys like cloud_authentication:rackspace:email
126
146
 
127
- 6. `cft cleanup_logs [DIRECTORIES_TO_NOT_DELETE]` this command allows you to clear your local log files
147
+ 7. `cft cleanup_logs [DIRECTORIES_TO_NOT_DELETE]` this command allows you to clear your local log files
128
148
 
129
149
  1. By default, this command will delete all the cheftacular directories in your log folder.
130
150
 
131
151
  2. This command supports a comma separated list of folders you don't want to delete.
132
152
 
133
- 7. `cft clear_caches` this command allows you to clear all of your local caches.
153
+ 8. `cft clear_caches` this command allows you to clear all of your local caches.
134
154
 
135
155
  1. This command will force you to refetch all previously cached chef server data on the next `cft` run.
136
156
 
137
- 8. `cft client_list` Allows you check the basic information for all the servers setup via chef. Shows the server's short name, its public ip address and roles (run_list) by default.
157
+ 9. `cft client_list` Allows you check the basic information for all the servers setup via chef. Shows the server's short name, its public ip address and roles (run_list) by default.
138
158
 
139
159
  1. `-v` option will make this command display the server's domain name, whether its password is stored on the chef server and what that password is.
140
160
 
@@ -148,7 +168,7 @@
148
168
 
149
169
  6. This command is aliased to `cft clients` and `cft cl`
150
170
 
151
- 9. `cft console` will create a console session on the first node found for a repository.
171
+ 10. `cft console` will create a console session on the first node found for a repository.
152
172
 
153
173
  1. Attempts to setup a console for the unique stack, stacks currently supported for console is only Rails.
154
174
 
@@ -156,13 +176,13 @@
156
176
 
157
177
  3. Aliased to `cft co`
158
178
 
159
- 10. `cft db_console` will create a database console session on the first node found for a database stack in the current environment.
179
+ 11. `cft db_console` will create a database console session on the first node found for a database stack in the current environment.
160
180
 
161
181
  1. This command is aliased to psql, typing `cft psql` will drop you into a rails stack database psql session.
162
182
 
163
183
  2. This command is also aliased to mongo, typing `cft mongo` will drop you into a mongodb mongo session.
164
184
 
165
- 11. `cft deploy [check|verify]` will do a simple chef-client run on the servers for a role. Logs of the run itself will be sent to the local log directory in the application (or chef-repo) where the run was conducted.
185
+ 12. `cft deploy [check|verify]` will do a simple chef-client run on the servers for a role. Logs of the run itself will be sent to the local log directory in the application (or chef-repo) where the run was conducted.
166
186
 
167
187
  1. The `-Z REVISION` flag can be used with TheCheftacularCookbook to set a revision your app will run.
168
188
 
@@ -182,13 +202,15 @@
182
202
 
183
203
  9. Aliased to `cft d`
184
204
 
185
- 12. `cft disk_report` will fetch useful statistics from every server for every environment and output it into your log directory.
205
+ 13. `cft disk_report` will fetch useful statistics from every server for every environment and output it into your log directory.
186
206
 
187
- 13. `cft env_ssh_exec [command]` will ssh into each server in an environment and run the command as sudo.
207
+ 14. `cft env_ssh_exec [command]` will ssh into each server in an environment and run the command as sudo.
188
208
 
189
209
  1. To deactivate logstash: `cft env_ssh_exec sv stop logstash_agent`
190
210
 
191
- 14. `cft environment boot|boot_without_deploy|destroy|destroy_raw_servers [SERVER_NAMES]` will boot / destroy the current environment
211
+ 2. To view a tree of all processes running on each server, run pstree -g
212
+
213
+ 15. `cft environment boot|boot_without_deploy|destroy|destroy_raw_servers [SERVER_NAMES]` will boot / destroy the current environment
192
214
 
193
215
  1. `boot` will spin up servers and bring them to a stable state. This includes setting up their subdomains for the target environment.
194
216
 
@@ -206,7 +228,7 @@
206
228
 
207
229
  8. Aliased to `cft e` and `cft env`
208
230
 
209
- 15. `cft file NODE_NAME LOCATION_ALIAS MODE FILE_NAME` interacts with a file on the remote server
231
+ 16. `cft file NODE_NAME LOCATION_ALIAS MODE FILE_NAME` interacts with a file on the remote server
210
232
 
211
233
  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
212
234
 
@@ -236,35 +258,35 @@
236
258
 
237
259
  1. `--save-to-file FILE_PATH` can also be used in the `fetch` context to specify where exactly to save the file and what to name it as.
238
260
 
239
- 16. `cft fix_known_hosts [HOSTNAME]` this command will delete entries in your known_hosts file for all the servers that are in our system (ip addresses AND dns names)
261
+ 17. `cft fix_known_hosts [HOSTNAME]` this command will delete entries in your known_hosts file for all the servers that are in our system (ip addresses AND dns names)
240
262
 
241
263
  1. Passing in a hostname will make the command only remove entries with that hostname / ip specifically
242
264
 
243
265
  2. Aliased to `cft fkh`
244
266
 
245
- 17. `cft get_active_ssh_connections` will fetch the active ssh connections from every server and output it into your log directory.
267
+ 18. `cft get_active_ssh_connections` will fetch the active ssh connections from every server and output it into your log directory.
246
268
 
247
269
  1. This command runs on all servers in an environment by default
248
270
 
249
271
  2. Packets can be examined more closely with `tcpdump src port PORT`
250
272
 
251
- 18. `cft get_haproxy_log` this command will generate a haproxy html file for the load balancer(s) associated with a repository in the log directory. Opening this log file in the browser will show the status of that haproxy at the time of the log.
273
+ 19. `cft get_haproxy_log` this command will generate a haproxy html file for the load balancer(s) associated with a repository in the log directory. Opening this log file in the browser will show the status of that haproxy at the time of the log.
252
274
 
253
275
  1. In devops mode, this command will not do anything without the -R repository passed.
254
276
 
255
- 19. `cft get_log_from_bag <NODE_NAME-COMMAND_TYPE>` this command grabs the latest command run log from the data bags and saves it to your log directory. There are different types of logs saved per server depending on command.
277
+ 20. `cft get_log_from_bag <NODE_NAME-COMMAND_TYPE>` this command grabs the latest command run log from the data bags and saves it to your log directory. There are different types of logs saved per server depending on command.
256
278
 
257
- 20. `cft get_pg_pass ['clip']` command will output the current environment's pg_password to your terminal. Optionally you can pass in clip like `cft get_pg_pass clip` to have it also copy the pass to your clipboard.
279
+ 21. `cft get_pg_pass ['clip']` command will output the current environment's pg_password to your terminal. Optionally you can pass in clip like `cft get_pg_pass clip` to have it also copy the pass to your clipboard.
258
280
 
259
- 21. `cft help COMMAND|MODE` this command returns the documentation for a specific command if COMMAND matches the name of a command. Alternatively, it can be passed `action|arguments|application|current|devops|stateless_action` to fetch the commands for a specific mode.Misspellings of commands will display near hits.
281
+ 22. `cft help COMMAND|MODE` this command returns the documentation for a specific command if COMMAND matches the name of a command. Alternatively, it can be passed `action|arguments|application|current|devops|stateless_action` to fetch the commands for a specific mode.Misspellings of commands will display near hits.
260
282
 
261
- 22. `cft list_toggleable_roles NODE_NAME` This command will allow you to see all toggleable roles for a node
283
+ 23. `cft list_toggleable_roles NODE_NAME` This command will allow you to see all toggleable roles for a node
262
284
 
263
- 23. `cft location_aliases` will list all location aliases listed in your cheftacular.yml. These aliases can be used in the `cft file` command.
285
+ 24. `cft location_aliases` will list all location aliases listed in your cheftacular.yml. These aliases can be used in the `cft file` command.
264
286
 
265
287
  1. This command is aliased to `cft la`
266
288
 
267
- 24. `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
289
+ 25. `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
268
290
 
269
291
  1. `--nginx` will fetch the nginx logs as well as the application logs
270
292
 
@@ -276,13 +298,13 @@
276
298
 
277
299
  4. `--fetch-backup` If doing a pg_data log, this will fetch the latest logs from the pg_data log directory for each database.
278
300
 
279
- 25. `cft migrate` this command will grab the first alphabetical node for a repository and run a migration that will hit the database primary server.
301
+ 26. `cft migrate` this command will grab the first alphabetical node for a repository and run a migration that will hit the database primary server.
280
302
 
281
303
  1. Currently only supports rails stacks.
282
304
 
283
- 26. `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
305
+ 27. `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
284
306
 
285
- 27. `cft role_toggle NODE_NAME ROLE_NAME activate|deactivate` This command will allow you to **toggle** roles on nodes without using `cft upload_nodes`
307
+ 28. `cft role_toggle NODE_NAME ROLE_NAME activate|deactivate` This command will allow you to **toggle** roles on nodes without using `cft upload_nodes`
286
308
 
287
309
  1. This command uses your *role_toggling:deactivated_role_suffix* attribute set in your cheftacular.yml to toggle the role, it checks to see if the toggled name exists then sets the node's run_list to include the toggled role
288
310
 
@@ -296,7 +318,7 @@
296
318
 
297
319
  4. Aliased to `cft rt`
298
320
 
299
- 28. `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.
321
+ 29. `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.
300
322
 
301
323
  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.
302
324
 
@@ -308,15 +330,15 @@
308
330
 
309
331
  5. Can also be used to run meteor commands and is aliased to `cft meteor`
310
332
 
311
- 29. `cft scale up|down [NUM_TO_SCALE]` will add (or remove) NUM_TO_SCALE servers from the server array. This command will not let you scale down below 1 server.
333
+ 30. `cft scale up|down [NUM_TO_SCALE]` will add (or remove) NUM_TO_SCALE servers from the server array. This command will not let you scale down below 1 server.
312
334
 
313
335
  1. In the case of server creation, this command takes a great deal of time to execute. It will output what stage it is currently on to the terminal but <b>you must not kill this command while it is executing</b>.A failed build may require the server to be destroyed / examined by a DevOps engineer.
314
336
 
315
- 30. `cft ssh NODE_NAME [exec] [command]` ssh you into the node name you are trying to access. It will also drop the server's sudo password into your clipboard.
337
+ 31. `cft ssh NODE_NAME [exec] [command]` ssh you into the node name you are trying to access. It will also drop the server's sudo password into your clipboard.
316
338
 
317
339
  1. `cft ssh NODE_NAME exec COMMAND` will execute a command on the server as root
318
340
 
319
- 31. `cft tail [PATTERN_TO_MATCH]` will tail the logs (return continuous output) of the first node if finds that has an application matching the repository running on it. Currently only supports rails stacks
341
+ 32. `cft tail [PATTERN_TO_MATCH]` will tail the logs (return continuous output) of the first node if finds that has an application matching the repository running on it. Currently only supports rails stacks
320
342
 
321
343
  1. pass `-n NODE_NAME` to grab the output of a node other than the first.
322
344
 
@@ -324,15 +346,17 @@
324
346
 
325
347
  3. if the `PATTERN_TO_MATCH` argument exists, the tail will only return entries that have that pattern rather than everything written to the file.
326
348
 
327
- 32. `cft update_cheftacular` this command attempts to update cheftacular to the latest version.
349
+ 4. If `--nginx` is specified, the tail will instead try and fetch data from the nginx instance on the matching node rather than the default.
350
+
351
+ 33. `cft update_cheftacular` this command attempts to update cheftacular to the latest version.
328
352
 
329
- 33. `cft verify` Checks to see if the servers for the current state are running the latest commits.
353
+ 34. `cft verify` Checks to see if the servers for the current state are running the latest commits.
330
354
 
331
355
  1. This command is functionally the same as `cft check verify`.
332
356
 
333
357
  2. This command is aliased to `cft ve`
334
358
 
335
- 34. `cft version` this command prints out the current version of cheftacular.
359
+ 35. `cft version` this command prints out the current version of cheftacular.
336
360
 
337
361
  1. Aliased to `cft v`
338
362
 
@@ -539,6 +563,8 @@
539
563
 
540
564
  1. To deactivate logstash: `cft env_ssh_exec sv stop logstash_agent`
541
565
 
566
+ 2. To view a tree of all processes running on each server, run pstree -g
567
+
542
568
  20. `cft environment boot|boot_without_deploy|destroy|destroy_raw_servers [SERVER_NAMES]` will boot / destroy the current environment
543
569
 
544
570
  1. `boot` will spin up servers and bring them to a stable state. This includes setting up their subdomains for the target environment.
@@ -695,6 +721,8 @@
695
721
 
696
722
  3. When `restart|stop|start SERVICE` is passed, the command will attempt to restart|stop|start the service if it has a .conf file on the remote server in the /etc/init directory.
697
723
 
724
+ 4. `--sv` will use sv syntax for processes that use runsv instead of the older service paradigm.
725
+
698
726
  44. `cft slack "MESSAGE" [CHANNEL]` will attempt to post the message to the webhook set in your cheftacular.yml. Slack posts to your default channel by default but if the CHANNEL argument is supplied the message will post there.
699
727
 
700
728
  1. NOTE: To prevent confusing spam from many possible sources, the username posted to slack will always be *Cheftacular*. This can be overloaded in the StatelessAction method "slack" but this is not recommended.
@@ -1,9 +1,9 @@
1
1
 
2
2
  class Cheftacular
3
- class StatelessActionDocumentation
3
+ class ActionDocumentation
4
4
  def application
5
- @config['documentation']['stateless_action'][__method__] ||= {}
6
- @config['documentation']['stateless_action'][__method__]['long_description'] = [
5
+ @config['documentation']['action'][__method__] ||= {}
6
+ @config['documentation']['action'][__method__]['long_description'] = [
7
7
  "`cft application boot|boot_without_deploy|destroy|destroy_raw_servers [SERVER_NAMES]` will boot / destroy the servers for current repository you are connected to",
8
8
 
9
9
  [
@@ -27,13 +27,13 @@ class Cheftacular
27
27
  ]
28
28
  ]
29
29
 
30
- @config['documentation']['stateless_action'][__method__]['short_description'] = 'Boots (or destroys) an application based on data stored in cheftacular.yml'
30
+ @config['documentation']['action'][__method__]['short_description'] = 'Boots (or destroys) an application based on data stored in cheftacular.yml'
31
31
 
32
32
  @config['documentation']['application'][__method__] = @config['documentation']['stateless_action'][__method__]
33
33
  end
34
34
  end
35
35
 
36
- class StatelessAction
36
+ class Action
37
37
  def application type='boot'
38
38
  type = ARGV[1] if ARGV[1]
39
39
 
@@ -155,7 +155,7 @@ class Cheftacular
155
155
  end
156
156
  end
157
157
 
158
- @config['auditor'].notify_slack_on_completion("environment #{ type } command completed for env: #{ @options['env'] }\n") if @config['cheftacular']['auditing']
158
+ @config['auditor'].notify_slack_on_completion("environment #{ type } command completed for env: #{ @options['env'] } (#{ initial_servers.keys.join(' ,') })\n") if @config['cheftacular']['auditing']
159
159
  end
160
160
 
161
161
  alias_method :e, :environment
@@ -1,5 +1,5 @@
1
1
  class Cheftacular
2
2
  #major_version.minor_version.bugfixes
3
- VERSION = "2.15.3"
3
+ VERSION = "2.15.4"
4
4
  RUBY_VERSION = "2.2.2"
5
5
  end
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.15.3
4
+ version: 2.15.4
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-04-29 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: chef-zero
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "<"
74
+ - !ruby/object:Gem::Version
75
+ version: 4.6.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: 4.6.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: berkshelf
71
85
  requirement: !ruby/object:Gem::Requirement