subspace 1.0.7 → 1.0.8

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
  SHA256:
3
- metadata.gz: 16254186781d02c9bcbae985b9251472b9daab254ba2db81dd03de7d7e464ce4
4
- data.tar.gz: 7e924dd5ff57579a5db778c7a5b109c9ce99f42df8855d4bda4ef82f42aa9d8d
3
+ metadata.gz: 502252722c12c738a1eb7fdd9223000f97511661be03d875f9d85a4ee0371a2d
4
+ data.tar.gz: 9d180bf402c16d0a178222a559548f1172877c175d16b2c7f01f3ef374993099
5
5
  SHA512:
6
- metadata.gz: 30673a2bbab4e6c6a8303eb3cf8ecbf1c15bd434a8adb757f3f9f6bbdd86867beb2066708bda03e1509a201cea5a9e253842ee257e58913e132e0a91beb98ff4
7
- data.tar.gz: b5dcbc7ecdafbef131c00911aa2f271b0586a9ad534f2ceb56936a5811d6d57f54c1440bab5acc81569c46bd5fe45083cee6a9c2b1d7ff9aa2ea9fc620e34d93
6
+ metadata.gz: c42b398e7e586f80670135895e65b890578aa606a36596492876f359e39a2160037edc387418833e72a9bd5c255b9bf0b5f4361403468c96c37fda10efcaa083
7
+ data.tar.gz: e0bec8f2360847cb043f657f63dfecde5397e6ecb78d8aca4b96fe4392ac508f01402378f7acef7bf87cb069296de1b7a7a4a74a057b3213f09fedb73f99ccd6
data/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ This is a [changelog](https://keepachangelog.com/en/0.3.0/).
4
4
 
5
5
  This project attempts to follow [semantic versioning](https://semver.org/)
6
6
 
7
+ ## Known Bugs
8
+
9
+ * Terminal Color
10
+ * Not working on OSX - macs don't read from /etc/profile.d/
11
+ * Stops showing color if you `sudo su`
12
+
13
+ ## 1.0.8
14
+
15
+ * enhancements
16
+ * Add support for `-i` in `subpsace ssh` command.
17
+
18
+ * bug fixes
19
+ * Check for all monit jobs stopping before changing config.
20
+ * Ensure /etc/profile.d/ exists
21
+
7
22
  ## 1.0.7
8
23
 
9
24
  * enhancements
@@ -2,17 +2,24 @@
2
2
  - name: Test connection
3
3
  ping:
4
4
 
5
+ - name: Ensure /etc/profile.d/ exists
6
+ file:
7
+ path: "/etc/profile.d/"
8
+ owner: root
9
+ state: directory
10
+ become: yes
11
+
5
12
  - name: Create terminal color file and make it executable
6
13
  file:
7
14
  path: "/etc/profile.d/termcolor.sh"
8
15
  state: touch
9
16
  mode: a+x
10
17
  become: true
11
-
18
+
12
19
  - name: Set terminal color
13
20
  vars:
14
- terminal_env_playbook: "{{terminal_env | default('not provided', true) }}"
15
- template:
21
+ terminal_env_playbook: "{{terminal_env | default('not provided', true) }}"
22
+ template:
16
23
  src: terminalcolor
17
24
  dest: "/etc/profile.d/termcolor.sh"
18
25
  become: true
@@ -4,7 +4,7 @@ This server brought to you by:
4
4
  \___ \| | | | '_ \___ \| '_ \ / _` |/ __/ _ \
5
5
  ___) | |_| | |_) |__) | |_) | (_| | (_| __/
6
6
  |____/ \__,_|_.__/____/| .__/ \__,_|\___\___|
7
- |_| v1.0.6
7
+ |_| v1.0.8
8
8
  ~~~ https://github.com/tenforwardconsulting/subspace ~~~
9
9
 
10
10
  If you need to make configuration changes to the server, please modify the
@@ -4,15 +4,21 @@
4
4
  - name: Monit Stop All
5
5
  shell: monit stop all
6
6
  become: true
7
+ ignore_errors: yes
8
+
9
+ - name: Wait for monit to stop
10
+ shell: monit status | grep Monitored | wc -l | awk '{print $1 $2}'
11
+ register: monit_stopped
12
+ retries: 10
13
+ until: monit_stopped.stdout == "0"
14
+ delay: 10
15
+ become: true
7
16
 
8
17
  - name: Install delayed_job monit script
9
18
  template:
10
19
  src: delayed-job-monit-rc
11
20
  dest: /etc/monit/conf.d/delayed_job_{{project_name}}_{{rails_env}}
12
21
  become: true
13
- notify:
14
- - reload_monit
15
- - restart_monit
16
22
 
17
23
  - name: Remove old upstart files
18
24
  file:
@@ -26,6 +32,14 @@
26
32
  state: absent
27
33
  become: true
28
34
 
29
- - name: Monit Start All
30
- shell: monit start all
35
+ - name: reload_monit
36
+ shell: monit reload
37
+ become: true
38
+
39
+ - name: wait
40
+ pause:
41
+ seconds: 3
42
+
43
+ - name: restart_monit
44
+ shell: monit restart all
31
45
  become: true
data/lib/subspace/cli.rb CHANGED
@@ -62,6 +62,9 @@ class Subspace::Cli
62
62
  c.summary = 'ssh to the remote server as the administrative user'
63
63
  c.description = ''
64
64
  c.option '--user USER', "Use a different user (eg deploy). Default is the ansible_ssh_user"
65
+ Subspace::Commands::Ssh::PASS_THROUGH_PARAMS.each do |param_name|
66
+ c.option "-#{param_name} #{param_name.upcase}", "Passed directly through to ssh command"
67
+ end
65
68
  c.when_called Subspace::Commands::Ssh
66
69
  end
67
70
 
@@ -1,8 +1,11 @@
1
1
  require 'yaml'
2
2
  class Subspace::Commands::Ssh < Subspace::Commands::Base
3
+ PASS_THROUGH_PARAMS = ["i"]
4
+
3
5
  def initialize(args, options)
4
6
  @host = args.first
5
7
  @user = options.user
8
+ @options = options
6
9
  run
7
10
  end
8
11
 
@@ -17,7 +20,16 @@ class Subspace::Commands::Ssh < Subspace::Commands::Base
17
20
  user = @user || host_vars["ansible_ssh_user"] || host_vars["ansible_user"]
18
21
  host = host_vars["ansible_ssh_host"] || host_vars["ansible_host"]
19
22
  port = host_vars["ansible_ssh_port"] || host_vars["ansible_port"] || 22
20
- cmd = "ssh #{user}@#{host} -p #{port}"
23
+ ssh_options = []
24
+ PASS_THROUGH_PARAMS.each do |param_name|
25
+ x = param_name.split('-')[1..-1].map(&:upcase).join('_')
26
+ hash_key = (param_name.gsub('-', '_') + (x == '' ? '' : "_#{x}")).to_sym
27
+ value = @options.__hash__[hash_key]
28
+ if value
29
+ ssh_options += ["-#{param_name}", value]
30
+ end
31
+ end
32
+ cmd = "ssh #{user}@#{host} -p #{port} #{ssh_options.join(" ")}"
21
33
  say cmd
22
34
  exec cmd
23
35
  end
@@ -1,3 +1,3 @@
1
1
  module Subspace
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Samson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-05 00:00:00.000000000 Z
11
+ date: 2019-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler