Skip to content

Commit 8d621fd

Browse files
committed
initial lift to 18.04
1 parent ca2f110 commit 8d621fd

File tree

11 files changed

+43
-69
lines changed

11 files changed

+43
-69
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/pillar/prod/secrets
2+
/ubuntu-bionic-18.04-cloudimg-console.log
23

34
*.py[cod]
45

Vagrantfile

+8-14
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ MASTER2 = "#{SUBNET2}.2"
3030

3131

3232
Vagrant.configure("2") do |config|
33-
config.vm.box = "ubuntu/trusty64"
33+
config.vm.box = "ubuntu/bionic64"
3434

3535
config.vm.define "salt-master" do |s_config|
3636
s_config.vm.hostname = "salt-master.vagrant.psf.io"
@@ -47,8 +47,8 @@ Vagrant.configure("2") do |config|
4747

4848
# Provision the salt-master.
4949
s_config.vm.provision :shell, :inline => <<-HEREDOC
50-
wget -O - https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
51-
echo 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main' > /etc/apt/sources.list.d/saltstack.list
50+
wget -O - https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
51+
echo 'deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main' > /etc/apt/sources.list.d/saltstack.list
5252
HEREDOC
5353

5454
s_config.vm.provision :shell, :inline => <<-HEREDOC
@@ -77,13 +77,13 @@ Vagrant.configure("2") do |config|
7777
server = server_c[:name]
7878
roles = server_c.fetch :roles, [server]
7979
box = server_c.fetch :box, nil
80-
codename = server_c.fetch :codename, "trusty"
80+
codename = server_c.fetch :codename, "bionic"
8181
ports = server_c.fetch :ports, []
8282
else
8383
server = server_c
8484
roles = [server_c]
8585
box = nil
86-
codename = "trusty"
86+
codename = "bionic"
8787
ports = []
8888
end
8989

@@ -101,16 +101,10 @@ Vagrant.configure("2") do |config|
101101
end
102102

103103
# Provision the salt-minion
104-
if codename == "trusty"
104+
if codename == "bionic"
105105
s_config.vm.provision :shell, :inline => <<-HEREDOC
106-
wget -O - https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
107-
echo 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main' > /etc/apt/sources.list.d/saltstack.list
108-
HEREDOC
109-
end
110-
if codename == "xenial"
111-
s_config.vm.provision :shell, :inline => <<-HEREDOC
112-
wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
113-
echo 'deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main' > /etc/apt/sources.list.d/saltstack.list
106+
wget -O - https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
107+
echo 'deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main' > /etc/apt/sources.list.d/saltstack.list
114108
HEREDOC
115109
end
116110

salt/_extensions/pillar/ca.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,18 @@ def create_ca(cacert_path, ca_name,
123123
ca.set_pubkey(key)
124124

125125
ca.add_extensions([
126-
OpenSSL.crypto.X509Extension('basicConstraints', True,
127-
'CA:TRUE, pathlen:0'),
128-
OpenSSL.crypto.X509Extension('keyUsage', True,
129-
'keyCertSign, cRLSign'),
130-
OpenSSL.crypto.X509Extension('subjectKeyIdentifier', False, 'hash',
126+
OpenSSL.crypto.X509Extension(b'basicConstraints', True,
127+
b'CA:TRUE, pathlen:0'),
128+
OpenSSL.crypto.X509Extension(b'keyUsage', True,
129+
b'keyCertSign, cRLSign'),
130+
OpenSSL.crypto.X509Extension(b'subjectKeyIdentifier', False, b'hash',
131131
subject=ca)])
132132

133133
ca.add_extensions([
134134
OpenSSL.crypto.X509Extension(
135-
'authorityKeyIdentifier',
135+
b'authorityKeyIdentifier',
136136
False,
137-
'issuer:always,keyid:always',
137+
b'issuer:always,keyid:always',
138138
issuer=ca)])
139139
ca.sign(key, digest)
140140

@@ -192,7 +192,7 @@ def create_ca_signed_cert(cacert_path, ca_name,
192192
fp.read(),
193193
)
194194
not_after = datetime.datetime.strptime(
195-
cert.get_notAfter(),
195+
cert.get_notAfter().decode(),
196196
"%Y%m%d%H%M%SZ",
197197
)
198198
ttl = (not_after - datetime.datetime.utcnow()).total_seconds()
@@ -252,10 +252,10 @@ def create_ca_signed_cert(cacert_path, ca_name,
252252

253253
cert.add_extensions([
254254
OpenSSL.crypto.X509Extension(
255-
"keyUsage", True, "digitalSignature, keyEncipherment",
255+
b"keyUsage", True, b"digitalSignature, keyEncipherment",
256256
),
257257
OpenSSL.crypto.X509Extension(
258-
"extendedKeyUsage", False, ", ".join(usage),
258+
b"extendedKeyUsage", False, ", ".join(usage).encode(),
259259
),
260260
])
261261

salt/base/repo.sls

+15-21
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,18 @@
55
- dir_mode: 755
66
- file_mode: 644
77

8-
9-
apt-transport-https:
10-
pkg.installed:
11-
- order: 2
12-
13-
14-
psf:
15-
pkgrepo.managed:
16-
- name: "deb https://packagecloud.io/psf/infra/ubuntu/ {{ grains['oscodename'] }} main"
17-
- file: /etc/apt/sources.list.d/psf.list
18-
- key_url: salt://base/config/APT-GPG-KEY-PSF
19-
- require:
20-
- pkg: apt-transport-https
21-
22-
# Make source list globally readable.
23-
/etc/apt/sources.list.d/psf.list:
24-
file.managed:
25-
- mode: 644
26-
- replace: False
27-
- require:
28-
- pkgrepo: psf
8+
#psf:
9+
# pkgrepo.managed:
10+
# - name: "deb https://packagecloud.io/psf/infra/ubuntu/ {{ grains['oscodename'] }} main"
11+
# - file: /etc/apt/sources.list.d/psf.list
12+
# - key_url: salt://base/config/APT-GPG-KEY-PSF
13+
# - require:
14+
# - pkg: apt-transport-https
15+
#
16+
## Make source list globally readable.
17+
#/etc/apt/sources.list.d/psf.list:
18+
# file.managed:
19+
# - mode: 644
20+
# - replace: False
21+
# - require:
22+
# - pkgrepo: psf

salt/base/salt.sls

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ python-requests:
44
python-msgpack:
55
pkg.latest
66

7+
python3-pip:
8+
pkg.latest
9+
710
{% if grains["os"] == "Ubuntu" %}
811
salt-2018.3:
912
pkgrepo.managed:
1013
- humanname: repo.saltstack.org
11-
- name: deb http://repo.saltstack.com/apt/ubuntu/{{ grains["osrelease"] }}/{{ grains["osarch"] }}/2018.3 {{ grains["oscodename"] }} main
14+
- name: deb http://repo.saltstack.com/py3/ubuntu/{{ grains["osrelease"] }}/{{ grains["osarch"] }}/2018.3 {{ grains["oscodename"] }} main
1215
- file: /etc/apt/sources.list.d/saltstack.list
13-
- key_url: https://repo.saltstack.com/apt/ubuntu/14.04/amd64/2018.3/SALTSTACK-GPG-KEY.pub
16+
- key_url: https://repo.saltstack.com/py3/ubuntu/18.04/amd64/2018.3/SALTSTACK-GPG-KEY.pub
1417
{% endif %}
1518

1619

salt/dns/init.sls

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
python-dyn:
2-
pkg.installed
1+
dyn:
2+
pip.installed
33

44

55
{% set ipv4_addrs = salt["mine.get"]("*", "ipv4_addrs") %}

salt/firewall/init.sls

-12
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,17 @@
2828

2929
iptables-persistent:
3030
pkg.installed:
31-
{% if grains["oscodename"] == "xenial" %}
3231
- name: netfilter-persistent
33-
{% else %}
34-
- name: iptables-persistent
35-
{% endif %}
3632

3733
service.enabled:
38-
{% if grains["oscodename"] == "xenial" %}
3934
- name: netfilter-persistent
40-
{% else %}
41-
- name: iptables-persistent
42-
{% endif %}
4335
- require:
4436
- file: /etc/iptables/rules.v4
4537
- file: /etc/iptables/rules.v6
4638

4739
module.watch:
4840
- name: service.restart
49-
{% if grains["oscodename"] == "xenial" %}
5041
- m_name: netfilter-persistent
51-
{% else %}
52-
- m_name: iptables-persistent
53-
{% endif %}
5442
- watch:
5543
- file: /etc/iptables/rules.v4
5644
- file: /etc/iptables/rules.v6

salt/nginx/init.sls

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
include:
2-
- monitoring.client.collectors.nginx
3-
4-
51
nginx:
62
pkgrepo.managed:
73
- name: deb http://nginx.org/packages/ubuntu/ {{ grains.oscodename }} nginx

salt/ssh/configs/sshd_config.jinja

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Ciphers [email protected],[email protected],aes128-gcm@openssh.
4949
# Note: We might need to add the SHA1 versions of these MACs for older clients
5050
# Note: Once https://github.com/paramiko/paramiko/pull/356 is released try to
5151
# remove hmac-sha1.
52-
MACs [email protected],[email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,hmac-sha1
52+
MACs [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-sha1
5353

5454
# Restrict ourselves to only secure KEXs
5555
# Note: We might need to add the DH-SHA1 versions of these MACs for older clients

salt/top.sls

-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ base:
66
- base.repo
77
- base.salt
88
- base.sanity
9-
- consul
109
- groups
1110
- users
1211
- ssh
1312
- firewall
1413
- sudoers
1514
- backup.client
16-
- monitoring.client
1715
- unattended-upgrades
1816
- tls
1917
- rsyslog

salt/users/init.sls

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ include:
4040

4141
user.present:
4242
- name: {{ user_name }}
43-
- fullname: {{ user_config["fullname"].decode('utf-8') }}
43+
- fullname: {{ user_config["fullname"] }}
4444
- home: /home/psf-users/{{ user_name }}
4545
- createhome: True
4646
- shell: {{ user_config.get("shell", "/bin/bash") }}

0 commit comments

Comments
 (0)