subspace 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/ansible/roles/common/tasks/main.yml +10 -3
- data/ansible/roles/common/templates/motd +1 -1
- data/ansible/roles/delayed_job/tasks/main.yml +19 -5
- data/lib/subspace/cli.rb +3 -0
- data/lib/subspace/commands/ssh.rb +13 -1
- data/lib/subspace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 502252722c12c738a1eb7fdd9223000f97511661be03d875f9d85a4ee0371a2d
|
4
|
+
data.tar.gz: 9d180bf402c16d0a178222a559548f1172877c175d16b2c7f01f3ef374993099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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:
|
30
|
-
shell: monit
|
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
|
-
|
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
|
data/lib/subspace/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|