subspace 2.2.1 → 2.3.2

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: b64ed71940340580eb07acb31250ae9789e90029f5767075fe8fc7b4eb2f159d
4
- data.tar.gz: d77efbd7886fff620e5c39bbd7be7d3cc6448b677ab6c9501c9f1eb4b40610a6
3
+ metadata.gz: d70ec4242c8be2ce016722c2d9898127ae130ebca3e83de4c315dea753ee22f0
4
+ data.tar.gz: 53f5b0d0ab09490196682e46a12b9d2e77994ff979fd8b5556ad8c8013a0f177
5
5
  SHA512:
6
- metadata.gz: 01eb907f9d1c43fd6230b5fddda42db24ec2b5c9184df4a69a6f40ec081bbe27b1d31f480bf67f238a22b38204faf6aa5a79237f2c4d1830a80339006e395c1f
7
- data.tar.gz: 54a67f7a9d613b50fe5898fee3b3bf764aeef9105d84521815a7fffa44a3b9382234213292ebbd277a3695dfec8d0a1276f95e47f18e0a20739248f3d958481a
6
+ metadata.gz: 937e805b162030f75968f34a265dd67570bc9787d117b3f8548fcb490c2444b0cb07bb1506614e9910d4b07e87b22a38780381a779e81c4f1e78bbf0f499aa91
7
+ data.tar.gz: 476d91fd00279a70ca8b7a922fde12710c9324ec67ce9a4ef4e991b2c7fdb72e949cac89cd121105239ca075fd32eac34c4cf89adb237c981e3e1f1e32d46f84
@@ -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.2
14
+ * Update papertrail to latest version of remote_syslog2 and add support for nginx logs
15
+
16
+ ## 2.3.1
17
+ * Sidekiq concurrency actually works
18
+
19
+ ## 2.3.0
20
+ * Grab linux kernel to send as stats
21
+ * Grab psql version to send as stats
22
+
23
+ ## 2.2.3
24
+ * Add PATH to crontab for letsencrypt auto renewal
25
+ * log letsencrypt crontab to /var/log/cron.log
26
+ * fix setting hostname with systemd
27
+
28
+ ## 2.2.2
29
+ * Use state: "present" instead of "installed"
30
+
13
31
  ## 2.2.1
14
32
  * Update URL for letsencrypt tls raw file
15
33
 
@@ -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.0.4
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 --quiet --no-self-upgrade --apache"
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 --quiet --no-self-upgrade --nginx"
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
@@ -3,4 +3,4 @@
3
3
  apt: update_cache=yes cache_valid_time=86400
4
4
 
5
5
  - name: Install Memcached.
6
- apt: name=memcached state=installed
6
+ apt: name=memcached state=present
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  passenger_webserver: "standalone"
3
- passenger_pkgs_state: "installed"
3
+ passenger_pkgs_state: "present"
4
4
  passenger_pkgs_fix_shebang: no
5
5
  become: true
@@ -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.13/remote_syslog_linux_amd64.tar.gz creates=/usr/bin/remote_syslog
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/examples/remote_syslog.init.d creates=/etc/init.d/remote_syslog
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,10 @@
20
20
 
21
21
  - file: path=/tmp/remote_syslog.tar.gz state=absent
22
22
 
23
- - service: name=remote_syslog state=restarted enabled=yes
23
+ - template: src=log_files.yml dest=/etc/log_files.yml owner=root group=root mode=0644
24
24
  become: true
25
25
 
26
- - template: src=log_files.yml dest=/etc/log_files.yml owner=root group=root mode=0644
26
+ - service: name=remote_syslog state=restarted enabled=yes
27
27
  become: true
28
+
29
+
@@ -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' in role_names %}
5
+ - /var/log/nginx/error.log
6
+ {% endif %}
7
+ {% if 'apache' in role_names %}
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: "{{item}}"
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: 5
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
@@ -26,7 +26,7 @@ class Subspace::Commands::Bootstrap < Subspace::Commands::Base
26
26
  "path=/home/{{ansible_ssh_user}}/.ssh state=directory mode=0700",
27
27
  "-vvvv"
28
28
  ]
29
- cmd = add_pass_through_params cmd
29
+ cmd = cmd | pass_through_params
30
30
  bootstrap_command cmd
31
31
  end
32
32
 
@@ -1,3 +1,3 @@
1
1
  module Subspace
2
- VERSION = "2.2.1"
2
+ VERSION = "2.3.2"
3
3
  end
@@ -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.12"
31
- spec.add_development_dependency "rake", "~> 10.0"
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.2.5
9
- ruby_checksum: 30c4b31697a4ca4ea0c8db8ad30cf45e6690a0f09687e5d483c933c03ca335e3
10
- ruby_download_location: 'http://cache.ruby-lang.org/pub/ruby/ruby-2.2.5.tar.gz'
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
- # passenger
13
- passenger_webserver: apache
14
- passenger_pkgs_state: installed
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.2.1
4
+ version: 2.3.2
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: 2019-12-04 00:00:00.000000000 Z
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.12'
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.12'
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: '10.0'
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: '10.0'
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.0.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: []