subspace 2.4.2 → 2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e15b70fcbd3ba32134d6b7a39e1eb1aa005a4f2cac2a25386cfc1362ad701c1e
4
- data.tar.gz: a77ca10a7cd9d1036b9f6f6277c6d392c53a64c6c0dcb870ff7d6a6826ab2b73
3
+ metadata.gz: 93091e9b151184634d780b924930692e79ba48fcf0ba21c565a4ab8583bf04e8
4
+ data.tar.gz: 43a0cc1057b2cc8805c52a646de12c841b79f4388966c0fe2a6bf25d34e0d7fe
5
5
  SHA512:
6
- metadata.gz: db89f1990335999622b3288c92a783ee0c8ee6e95b5ac67a0045ce17c4cf802288af1a7799524fa7ee94cd19e6a5a31359137eeee33b4da22110555c40bf9bbd
7
- data.tar.gz: ea1f49c671900d20ea08f68f3174e21ca3ebf582606c1c56e328926f532c9d7683be70f13f92341fffde0a937c55d4b9d4fc2afa97617136801794304bdb9984
6
+ metadata.gz: e8a80cd668afcbc735bdde1e1067f2428f936a1ea4cb3c5f09d921e14630f61e01e5fd2d09ecf651a2338e94b9c9dc7c1d504f0d87773a4385ac4e5c62d589cd
7
+ data.tar.gz: 39a99a8d46d0e7b3b794ddffc5eda3873c445cd3df8083d95a3fc888ba1b29ce3808bbad2bbeba0a9619637b9c2e78baafd9ae581b8a7355417df80cb21afc1b
@@ -10,6 +10,11 @@ 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.5
14
+ * Get actual os version number along with kernal name
15
+ * Update MOTD version automatically!
16
+ * Get and upload unattended security updates
17
+
13
18
  ## 2.4.2
14
19
  * Update deprecated syntax for ansible
15
20
  * Fix postgresql-client for python 3
@@ -158,6 +158,42 @@
158
158
  - maintenance
159
159
  - stats
160
160
 
161
+ - name: Get unattended security updates
162
+ shell:
163
+ cmd: cat /var/log/unattended-upgrades/unattended-upgrades.log | grep "Packages that will be upgraded:" | grep $(date '+%Y-%m') | cut -d " " -f 9- | wc -w
164
+ register: out
165
+ tags:
166
+ - maintenance
167
+ - stats
168
+
169
+ - name: get current date as month
170
+ shell:
171
+ cmd: date '+%Y-%m'
172
+ register: current_month
173
+ tags:
174
+ - maintenance
175
+ - stats
176
+
177
+ - name: Save unattended updates to /opt/subspace/updates.log
178
+ lineinfile:
179
+ path: /opt/subspace/updates.log
180
+ line: "[{{current_month.stdout}}]\n{{ out.stdout }} unattended security updates"
181
+ insertafter: EOF
182
+ create: yes
183
+ become: true
184
+ tags:
185
+ - maintenance
186
+ - stats
187
+ when: out.stdout != "0"
188
+
189
+ - name: Update unattended-upgrades.log
190
+ shell:
191
+ cmd: perl -i -pe 's/Packages that will be upgraded:/Packages already upgraded and logged in Subspace:/smg' /var/log/unattended-upgrades/unattended-upgrades.log
192
+ become: true
193
+ tags:
194
+ - maintenance
195
+ - stats
196
+
161
197
  - name: Get os_security_upgrades stats
162
198
  shell:
163
199
  cmd: |
@@ -253,7 +289,7 @@
253
289
  - maintenance
254
290
 
255
291
  - name: Grab OS version
256
- shell: uname --kernel-release
292
+ shell: uname -rv
257
293
  register: stats_os_version
258
294
  when: send_stats == true and stats_url is defined and stats_api_key is defined
259
295
  tags:
@@ -4,7 +4,7 @@ This server brought to you by:
4
4
  \___ \| | | | '_ \___ \| '_ \ / _` |/ __/ _ \
5
5
  ___) | |_| | |_) |__) | |_) | (_| | (_| __/
6
6
  |____/ \__,_|_.__/____/| .__/ \__,_|\___\___|
7
- |_| v2.4.2
7
+ |_| v{{lookup('env', 'SUBSPACE_VERSION')}}
8
8
  ~~~ https://github.com/tenforwardconsulting/subspace ~~~
9
9
 
10
10
  If you need to make configuration changes to the server, please modify the
@@ -70,6 +70,10 @@ module Subspace
70
70
 
71
71
  ansible_options
72
72
  end
73
+
74
+ def set_subspace_version
75
+ ENV['SUBSPACE_VERSION'] = Subspace::VERSION
76
+ end
73
77
  end
74
78
  end
75
79
  end
@@ -4,6 +4,7 @@ class Subspace::Commands::Maintain < Subspace::Commands::Base
4
4
  def initialize(args, options)
5
5
  @environment = args.first
6
6
  @options = options
7
+ set_subspace_version
7
8
  run
8
9
  end
9
10
 
@@ -4,6 +4,7 @@ class Subspace::Commands::Provision < Subspace::Commands::Base
4
4
  def initialize(args, options)
5
5
  @environment = args.first
6
6
  @options = options
7
+ set_subspace_version
7
8
  run
8
9
  end
9
10
 
@@ -1,3 +1,3 @@
1
1
  module Subspace
2
- VERSION = "2.4.2"
2
+ VERSION = "2.5"
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: 2.4.2
4
+ version: '2.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Samson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-08 00:00:00.000000000 Z
11
+ date: 2021-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler