subspace 2.2.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/ansible/roles/apache/tasks/main.yml +4 -0
- data/ansible/roles/collectd/tasks/main.yml +2 -2
- data/ansible/roles/common/tasks/main.yml +27 -0
- data/ansible/roles/common/templates/motd +1 -1
- data/ansible/roles/letsencrypt/tasks/main.yml +12 -6
- data/ansible/roles/nginx/tasks/main.yml +4 -0
- data/ansible/roles/papertrail/tasks/main.yml +8 -4
- data/ansible/roles/papertrail/templates/log_files.yml +8 -1
- data/ansible/roles/postgresql-client/tasks/main.yml +26 -0
- data/ansible/roles/postgresql/tasks/main.yml +26 -0
- data/ansible/roles/rails/tasks/main.yml +1 -10
- data/ansible/roles/sidekiq/defaults/main.yml +1 -1
- data/ansible/roles/sidekiq/templates/sidekiq-monit-rc +1 -1
- data/lib/subspace/version.rb +1 -1
- data/subspace.gemspec +2 -2
- data/template/provision/group_vars/all.erb +9 -6
- data/template/provision/templates/application.yml.template +11 -11
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d486a8c58000fa5ffe980ccf53ba74bec6a42e4f437f67d1ad763a563f62d8fa
|
4
|
+
data.tar.gz: 4222caa44b5be3baf9f81366a2afced697891d5fe1c3b4b06c797f4f36c96781
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a326248f9f5cc36515902ef3cf8a0dd58655998925f3a82449310383fa2f5bbc97bf23b8d5f7a0e42552d8563c27281174d244faf657b0944d65af3d7d3aedc
|
7
|
+
data.tar.gz: f6d685d12230db7ce1daaa89e35c2b776bf7c7af968ed6c9c4c56b7fb5203e9df7ce9e63623bec20ab8a9166cffd1e156b6073544b2e57629ec9eea172bb24e4
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,24 @@ This project attempts to follow [semantic versioning](https://semver.org/)
|
|
10
10
|
* Not working on OSX - macs don't read from /etc/profile.d/
|
11
11
|
* Stops showing color if you `sudo su`
|
12
12
|
|
13
|
+
## 2.3.3
|
14
|
+
* Tweak the way that different roles are detected to be more reliable
|
15
|
+
|
16
|
+
## 2.3.2
|
17
|
+
* Update papertrail to latest version of remote_syslog2 and add support for nginx logs
|
18
|
+
|
19
|
+
## 2.3.1
|
20
|
+
* Sidekiq concurrency actually works
|
21
|
+
|
22
|
+
## 2.3.0
|
23
|
+
* Grab linux kernel to send as stats
|
24
|
+
* Grab psql version to send as stats
|
25
|
+
|
26
|
+
## 2.2.3
|
27
|
+
* Add PATH to crontab for letsencrypt auto renewal
|
28
|
+
* log letsencrypt crontab to /var/log/cron.log
|
29
|
+
* fix setting hostname with systemd
|
30
|
+
|
13
31
|
## 2.2.2
|
14
32
|
* Use state: "present" instead of "installed"
|
15
33
|
|
@@ -47,7 +47,7 @@
|
|
47
47
|
dest: /etc/collectd/collectd.conf.d/apache2.conf
|
48
48
|
become: true
|
49
49
|
notify: restart collectd
|
50
|
-
when:
|
50
|
+
when: apache_installed is defined
|
51
51
|
|
52
52
|
- name: create puma config
|
53
53
|
template:
|
@@ -70,7 +70,7 @@
|
|
70
70
|
dest: /etc/collectd/collectd.conf.d/nginx.conf
|
71
71
|
become: true
|
72
72
|
notify: restart collectd
|
73
|
-
when:
|
73
|
+
when: nginx_installed is defined
|
74
74
|
|
75
75
|
- name: create rails_lograge config
|
76
76
|
template:
|
@@ -59,6 +59,7 @@
|
|
59
59
|
- name: Set hostname for systemd
|
60
60
|
hostname:
|
61
61
|
name: "{{hostname}}"
|
62
|
+
use: systemd
|
62
63
|
become: true
|
63
64
|
tags:
|
64
65
|
- maintenance
|
@@ -251,4 +252,30 @@
|
|
251
252
|
tags:
|
252
253
|
- maintenance
|
253
254
|
|
255
|
+
- name: Grab OS version
|
256
|
+
shell: uname --kernel-release
|
257
|
+
register: stats_os_version
|
258
|
+
when: send_stats == true and stats_url is defined and stats_api_key is defined
|
259
|
+
tags:
|
260
|
+
- maintenance
|
261
|
+
- stats
|
262
|
+
|
263
|
+
- name: Send OS stats to URL
|
264
|
+
uri:
|
265
|
+
url: "{{stats_url}}"
|
266
|
+
method: POST
|
267
|
+
headers:
|
268
|
+
X-API-Version: 1
|
269
|
+
X-Client-Api-key: "{{stats_api_key}}"
|
270
|
+
body_format: json
|
271
|
+
body:
|
272
|
+
client_stat:
|
273
|
+
key: os_version
|
274
|
+
value: "{{stats_os_version.stdout}}"
|
275
|
+
hostname: "{{hostname}}"
|
276
|
+
when: send_stats == true and stats_url is defined and stats_api_key is defined
|
277
|
+
tags:
|
278
|
+
- maintenance
|
279
|
+
- stats
|
280
|
+
|
254
281
|
- import_tasks: swap.yml
|
@@ -4,7 +4,7 @@ This server brought to you by:
|
|
4
4
|
\___ \| | | | '_ \___ \| '_ \ / _` |/ __/ _ \
|
5
5
|
___) | |_| | |_) |__) | |_) | (_| | (_| __/
|
6
6
|
|____/ \__,_|_.__/____/| .__/ \__,_|\___\___|
|
7
|
-
|_| v2.
|
7
|
+
|_| v2.3.1
|
8
8
|
~~~ https://github.com/tenforwardconsulting/subspace ~~~
|
9
9
|
|
10
10
|
If you need to make configuration changes to the server, please modify the
|
@@ -74,14 +74,20 @@
|
|
74
74
|
notify: start webserver
|
75
75
|
changed_when: true
|
76
76
|
|
77
|
+
- name: Set path at top of crontab
|
78
|
+
cron:
|
79
|
+
name: PATH
|
80
|
+
env: yes
|
81
|
+
job: /usr/bin:/bin:/usr/sbin
|
82
|
+
|
77
83
|
- name: Setup cron job to auto renew
|
78
84
|
become: true
|
79
85
|
when: "'apache' in role_names"
|
80
86
|
cron:
|
81
87
|
name: Auto-renew SSL
|
82
|
-
job: "{{certbot_dir}}/certbot-auto renew --
|
83
|
-
hour: 0
|
84
|
-
minute: 33
|
88
|
+
job: "{{certbot_dir}}/certbot-auto renew --no-self-upgrade --apache >> /var/log/cron.log 2>&1"
|
89
|
+
hour: "0"
|
90
|
+
minute: "33"
|
85
91
|
state: present
|
86
92
|
|
87
93
|
- name: Setup cron job to auto renew
|
@@ -89,7 +95,7 @@
|
|
89
95
|
when: "'nginx' in role_names"
|
90
96
|
cron:
|
91
97
|
name: Auto-renew SSL
|
92
|
-
job: "{{certbot_dir}}/certbot-auto renew --
|
93
|
-
hour: 0
|
94
|
-
minute: 33
|
98
|
+
job: "{{certbot_dir}}/certbot-auto renew --no-self-upgrade --nginx >> /var/log/cron.log 2>&1"
|
99
|
+
hour: "0"
|
100
|
+
minute: "33"
|
95
101
|
state: present
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- name: Install remote_syslog from papertrail
|
3
|
-
command: wget -O /tmp/remote_syslog.tar.gz https://github.com/papertrail/remote_syslog2/releases/download/v0.
|
3
|
+
command: wget -O /tmp/remote_syslog.tar.gz https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote_syslog_linux_amd64.tar.gz creates=/usr/bin/remote_syslog
|
4
4
|
|
5
5
|
- command: tar xzf /tmp/remote_syslog.tar.gz chdir=/tmp/ creates=/usr/bin/remote_syslog
|
6
6
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
- file: path=/usr/bin/remote_syslog owner=root group=root mode=0755
|
11
11
|
become: true
|
12
12
|
|
13
|
-
- command: wget -O /etc/init.d/remote_syslog https://raw.githubusercontent.com/papertrail/remote_syslog2/v0.
|
13
|
+
- command: wget -O /etc/init.d/remote_syslog https://raw.githubusercontent.com/papertrail/remote_syslog2/v0.20/examples/remote_syslog.init.d creates=/etc/init.d/remote_syslog
|
14
14
|
become: true
|
15
15
|
|
16
16
|
- file: path=/etc/init.d/remote_syslog owner=root group=root mode=0755
|
@@ -20,8 +20,12 @@
|
|
20
20
|
|
21
21
|
- file: path=/tmp/remote_syslog.tar.gz state=absent
|
22
22
|
|
23
|
-
-
|
23
|
+
- name: Create /etc/log_files
|
24
|
+
template: src=log_files.yml dest=/etc/log_files.yml owner=root group=root mode=0644
|
24
25
|
become: true
|
25
26
|
|
26
|
-
-
|
27
|
+
- name: Restart rsyslog
|
28
|
+
service: name=remote_syslog state=restarted enabled=yes
|
27
29
|
become: true
|
30
|
+
|
31
|
+
|
@@ -1,7 +1,14 @@
|
|
1
1
|
# Variables: papertrail_host, papertrail_port
|
2
2
|
files:
|
3
|
-
- /var/log/apache2/error.log
|
4
3
|
- /u/apps/{{project_name}}/shared/log/{{rails_env}}.log
|
4
|
+
{% if nginx_installed is defined %}
|
5
|
+
- /var/log/nginx/error.log
|
6
|
+
{% endif %}
|
7
|
+
{% if apache_installed is defined %}
|
8
|
+
- /var/log/apache2/error.log
|
9
|
+
{% endif %}
|
10
|
+
|
5
11
|
destination:
|
6
12
|
host: {{papertrail_host}}
|
7
13
|
port: {{papertrail_port}}
|
14
|
+
protocol: tls
|
@@ -47,3 +47,29 @@
|
|
47
47
|
- postgresql
|
48
48
|
- db
|
49
49
|
- deps
|
50
|
+
|
51
|
+
- name: Grab Psql version
|
52
|
+
shell: psql --version
|
53
|
+
register: stats_psql_version
|
54
|
+
when: send_stats == true and stats_url is defined and stats_api_key is defined
|
55
|
+
tags:
|
56
|
+
- maintenance
|
57
|
+
- stats
|
58
|
+
|
59
|
+
- name: Send Psql stats to URL
|
60
|
+
uri:
|
61
|
+
url: "{{stats_url}}"
|
62
|
+
method: POST
|
63
|
+
headers:
|
64
|
+
X-API-Version: 1
|
65
|
+
X-Client-Api-key: "{{stats_api_key}}"
|
66
|
+
body_format: json
|
67
|
+
body:
|
68
|
+
client_stat:
|
69
|
+
key: psql_version
|
70
|
+
value: "{{stats_psql_version.stdout}}"
|
71
|
+
hostname: "{{hostname}}"
|
72
|
+
when: send_stats == true and stats_url is defined and stats_api_key is defined
|
73
|
+
tags:
|
74
|
+
- maintenance
|
75
|
+
- stats
|
@@ -38,3 +38,29 @@
|
|
38
38
|
|
39
39
|
- include: backups.yml
|
40
40
|
become: true
|
41
|
+
|
42
|
+
- name: Grab Psql version
|
43
|
+
shell: psql --version
|
44
|
+
register: stats_psql_version
|
45
|
+
when: send_stats == true and stats_url is defined and stats_api_key is defined
|
46
|
+
tags:
|
47
|
+
- maintenance
|
48
|
+
- stats
|
49
|
+
|
50
|
+
- name: Send Psql stats to URL
|
51
|
+
uri:
|
52
|
+
url: "{{stats_url}}"
|
53
|
+
method: POST
|
54
|
+
headers:
|
55
|
+
X-API-Version: 1
|
56
|
+
X-Client-Api-key: "{{stats_api_key}}"
|
57
|
+
body_format: json
|
58
|
+
body:
|
59
|
+
client_stat:
|
60
|
+
key: psql_version
|
61
|
+
value: "{{stats_psql_version.stdout}}"
|
62
|
+
hostname: "{{hostname}}"
|
63
|
+
when: send_stats == true and stats_url is defined and stats_api_key is defined
|
64
|
+
tags:
|
65
|
+
- maintenance
|
66
|
+
- stats
|
@@ -1,16 +1,7 @@
|
|
1
1
|
---
|
2
2
|
- name: Install rails apt dependencies
|
3
3
|
apt:
|
4
|
-
name:
|
5
|
-
with_items:
|
6
|
-
- git
|
7
|
-
- libffi-dev
|
8
|
-
- libgmp3-dev
|
9
|
-
- libpq-dev
|
10
|
-
- libxslt-dev
|
11
|
-
- nodejs
|
12
|
-
- zlib1g-dev
|
13
|
-
- ffmpeg
|
4
|
+
name: ['git', 'libffi-dev', 'libgmp3-dev', 'libpq-dev', 'libxslt-dev', 'nodejs', 'zlib1g-dev' ,'ffmpeg']
|
14
5
|
become: true
|
15
6
|
when: ('Ubuntu' in ansible_distribution)
|
16
7
|
tags:
|
@@ -1,2 +1,2 @@
|
|
1
1
|
---
|
2
|
-
sidekiq_concurrency:
|
2
|
+
sidekiq_concurrency: 10
|
@@ -1,4 +1,4 @@
|
|
1
1
|
check process sidekiq
|
2
2
|
with pidfile /u/apps/{{project_name}}/shared/tmp/pids/sidekiq.pid
|
3
|
-
start program = "/bin/su - deploy -c 'cd /u/apps/{{project_name}}/current && bundle exec sidekiq --queue {{hostname}} {{ job_queues | map('regex_replace', '^(.*)$', '--queue \\1') | join(' ') }} --pidfile /u/apps/{{project_name}}/shared/tmp/pids/sidekiq.pid --environment {{rails_env}} --logfile /u/apps/{{project_name}}/shared/log/sidekiq.log --daemon'" with timeout 30 seconds
|
3
|
+
start program = "/bin/su - deploy -c 'cd /u/apps/{{project_name}}/current && bundle exec sidekiq --queue {{hostname}} {{ job_queues | map('regex_replace', '^(.*)$', '--queue \\1') | join(' ') }} -c {{sidekiq_concurrency}} --pidfile /u/apps/{{project_name}}/shared/tmp/pids/sidekiq.pid --environment {{rails_env}} --logfile /u/apps/{{project_name}}/shared/log/sidekiq.log --daemon'" with timeout 30 seconds
|
4
4
|
stop program = "/bin/su - deploy -c 'kill -s TERM `cat /u/apps/{{project_name}}/shared/tmp/pids/sidekiq.pid`'" with timeout 30 seconds
|
data/lib/subspace/version.rb
CHANGED
data/subspace.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~> 1
|
31
|
-
spec.add_development_dependency "rake", "~>
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
31
|
+
spec.add_development_dependency "rake", "~> 12.3.3"
|
32
32
|
spec.add_development_dependency "rspec", "~> 3.0"
|
33
33
|
|
34
34
|
spec.add_runtime_dependency "commander", "~>4.2"
|
@@ -5,10 +5,13 @@ use_sudo: true
|
|
5
5
|
|
6
6
|
# ruby-common
|
7
7
|
# pull the checksum/url from https://www.ruby-lang.org/en/downloads/
|
8
|
-
ruby_version: ruby-2.
|
9
|
-
ruby_checksum:
|
10
|
-
ruby_download_location:
|
8
|
+
ruby_version: ruby-2.7.1
|
9
|
+
ruby_checksum: d418483bdd0000576c1370571121a6eb24582116db0b7bb2005e90e250eae418
|
10
|
+
ruby_download_location: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.gz
|
11
|
+
bundler_version: 2.1.4
|
11
12
|
|
12
|
-
#
|
13
|
-
|
14
|
-
|
13
|
+
# Other stuff
|
14
|
+
letsencrypt_email:
|
15
|
+
nodejs_version: 13.x
|
16
|
+
ssl_enabled: true
|
17
|
+
postgresql_version: 11.7
|
@@ -4,24 +4,24 @@
|
|
4
4
|
# These environment variables are available to all environments, and can be secret or not:
|
5
5
|
|
6
6
|
# These are secret and can be changed per environment easily by using subspace vars <env> --edit
|
7
|
-
SECRET_KEY_BASE: {{SECRET_KEY_BASE}}
|
8
|
-
AWS_SECRET_KEY: {{AWS_SECRET_KEY}}
|
7
|
+
# SECRET_KEY_BASE: {{SECRET_KEY_BASE}}
|
8
|
+
# AWS_SECRET_KEY: {{AWS_SECRET_KEY}}
|
9
9
|
|
10
10
|
# These are not secret, and have the same value for all environments
|
11
|
-
ENABLE_SOME_FEATURE: false
|
12
|
-
MAX_USER_INVITES: 20
|
13
|
-
DEFAULT_EMAIL_ADDRESS: test@example.com
|
11
|
+
# ENABLE_SOME_FEATURE: false
|
12
|
+
# MAX_USER_INVITES: 20
|
13
|
+
# DEFAULT_EMAIL_ADDRESS: test@example.com
|
14
14
|
|
15
15
|
|
16
16
|
# These variable are not secret, but have different, static values for all environments
|
17
17
|
development:
|
18
|
-
INSECURE_VARIABLE: "this isn't secret"
|
19
|
-
AWS_BUCKET: my-app-development
|
18
|
+
# INSECURE_VARIABLE: "this isn't secret"
|
19
|
+
# AWS_BUCKET: my-app-development
|
20
20
|
|
21
21
|
dev:
|
22
|
-
INSECURE_VARIABLE: "but it changes"
|
23
|
-
AWS_BUCKET: my-app-dev
|
22
|
+
# INSECURE_VARIABLE: "but it changes"
|
23
|
+
# AWS_BUCKET: my-app-dev
|
24
24
|
|
25
25
|
production:
|
26
|
-
INSECURE_VARIABLE: "on different servers"
|
27
|
-
AWS_BUCKET: my-app-production
|
26
|
+
# INSECURE_VARIABLE: "on different servers"
|
27
|
+
# AWS_BUCKET: my-app-production
|
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: 2.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Samson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 12.3.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 12.3.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -288,7 +288,7 @@ licenses:
|
|
288
288
|
- MIT
|
289
289
|
metadata:
|
290
290
|
allowed_push_host: https://rubygems.org
|
291
|
-
post_install_message:
|
291
|
+
post_install_message:
|
292
292
|
rdoc_options: []
|
293
293
|
require_paths:
|
294
294
|
- lib
|
@@ -303,8 +303,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
303
303
|
- !ruby/object:Gem::Version
|
304
304
|
version: '0'
|
305
305
|
requirements: []
|
306
|
-
rubygems_version: 3.
|
307
|
-
signing_key:
|
306
|
+
rubygems_version: 3.1.4
|
307
|
+
signing_key:
|
308
308
|
specification_version: 4
|
309
309
|
summary: Ansible-based server provisioning for rails projects
|
310
310
|
test_files: []
|