Skip to content

Commit a89c21d

Browse files
authored
Migrate salt-master to Ubuntu 22.04('Jammy') (#331)
* Migrate salt-master to jammy This commit uncomments out code that will migrate our salt-master to run using Ubuntu 22.04 codename 'jammy'. * Run salt-master as root user In our previoius configuration, the salt master was running as root user. When migrating to salt latest 3006, the salt-master defaults to running as the salt user. To bypass permissions errors around loading `consul.py` and `ca.py`, this commit runs the salt-master as the root user as done previously before attempting to upgrade salt. * Expand condtional statement to include codename "jammy" The `python-requests` and `python-msgpack` packages were not getting loaded for our salt-master because there was no condtion to match it's oscodename. This commit changes that. * Upadte saltstack repository configuration for codename "jammy" This commit applies a condition for codename jammy to use the appropriate salt repository, updating the repo URL, path name, and GPG key for Ubuntu 22.04. * Adjust `consul` to run with jammy Adjust `consul` configuration for compatibility with Ubuntu 22.04 ('Jammy') * Remove comment This comment is no longer necessary, as the salt-master now runs on Ubuntu 22.04 codename "Jammy". * Update salt GPG keyring name - this change reflects the GPG keyring name, and apt source file list in [Salt Install Guide]https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/ubuntu.html) * Address apt-key deprecation for packagecloud - this commit addresses the recommended approach for [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html) * Address apt-key deprecation for salt - this commit addresses the reccomended approach for [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html) * Address apt-key deprecation for datadoghq - this commit addresses the reccomended approach for [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html) * Address apt-key deprecation for nginx - this commit addresses the reccomended approach for [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html)
1 parent 6350a33 commit a89c21d

File tree

7 files changed

+30
-12
lines changed

7 files changed

+30
-12
lines changed

Vagrantfile

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SERVERS = [
77
"buildbot",
88
"cdn-logs",
99
"codespeed",
10-
"consul",
10+
{:name => "consul", :codename => "jammy"},
1111
"docs",
1212
"downloads",
1313
"hg",
@@ -40,11 +40,10 @@ Vagrant.configure("2") do |config|
4040
end
4141

4242
config.vm.define "salt-master" do |s_config|
43-
# Uncomment below to migrate salt-master to jammy
44-
# s_config.vm.provider "docker" do |docker, override|
45-
# docker.build_dir = "dockerfiles"
46-
# docker.dockerfile = "Dockerfile.jammy"
47-
# end
43+
s_config.vm.provider "docker" do |docker, override|
44+
docker.build_dir = "dockerfiles"
45+
docker.dockerfile = "Dockerfile.jammy"
46+
end
4847

4948
s_config.vm.hostname = "salt-master.vagrant.psf.io"
5049
s_config.vm.network "private_network", ip: MASTER1

conf/vagrant/master.conf

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ failhard: True
44

55
extension_modules: srv/salt/_extensions
66

7+
user: root
8+
79
pillar_roots:
810
base:
911
- /srv/pillar/dev

dockerfiles/Dockerfile.jammy

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ EXPOSE 22
4747
RUN /usr/sbin/sshd
4848

4949
# Setup Salt Common
50-
51-
RUN wget --quiet -O /etc/apt/keyrings/SALT-PROJECT-GPG-PUBKEY-2023.gpg https://repo.saltproject.io/salt/py3/ubuntu/22.04/$(dpkg --print-architecture)/SALT-PROJECT-GPG-PUBKEY-2023.gpg
52-
RUN echo "deb [signed-by=/etc/apt/keyrings/SALT-PROJECT-GPG-PUBKEY-2023.gpg arch=$(dpkg --print-architecture)] https://repo.saltproject.io/salt/py3/ubuntu/22.04/$(dpkg --print-architecture)/3006 jammy main" > /etc/apt/sources.list.d/saltstack.list
50+
RUN wget --quiet -O /etc/apt/keyrings/salt-archive-keyring-2023.gpg https://repo.saltproject.io/salt/py3/ubuntu/22.04/$(dpkg --print-architecture)/SALT-PROJECT-GPG-PUBKEY-2023.gpg
51+
RUN echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=$(dpkg --print-architecture)] https://repo.saltproject.io/salt/py3/ubuntu/22.04/$(dpkg --print-architecture)/3006 jammy main" > /etc/apt/sources.list.d/salt.list
5352
RUN apt-get update -y && apt-get install -y --no-install-recommends salt-minion
5453

5554
# Start Systemd (systemctl)

salt/base/repo.sls

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
psf:
99
pkgrepo.managed:
10-
- name: "deb https://packagecloud.io/psf/infra/ubuntu {{ grains['oscodename'] }} main"
10+
- name: "deb [signed-by=/etc/apt/keyrings/packagecloud.gpg arch={{ grains["osarch"] }}] https://packagecloud.io/psf/infra/ubuntu {{ grains['oscodename'] }} main"
1111
- file: /etc/apt/sources.list.d/psf.list
1212
- key_url: salt://base/config/APT-GPG-KEY-PSF
13+
- aptkey: False
1314
1415
# Make source list globally readable.
1516
/etc/apt/sources.list.d/psf.list:

salt/base/salt.sls

+15
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ python-requests:
66
python-msgpack:
77
pkg.latest:
88
- name: python3-msgpack
9+
10+
{% elif grains["oscodename"] == "jammy" %}
11+
python-requests:
12+
pkg.latest:
13+
- name: python3-requests
14+
15+
python-msgpack:
16+
pkg.latest:
17+
- name: python3-msgpack
18+
919
{% else %}
1020
python-requests:
1121
pkg.latest
@@ -24,6 +34,11 @@ salt-2018.3:
2434
{% if grains["oscodename"] == "focal" %}
2535
- name: deb https://archive.repo.saltproject.io/py3/ubuntu/20.04/{{ grains["osarch"] }}/archive/3004 focal main
2636
- key_url: https://archive.repo.saltproject.io/py3/ubuntu/20.04/{{ grains["osarch"] }}/archive/3004/salt-archive-keyring.gpg
37+
{% elif grains["oscodename"] == "jammy" %}
38+
- name: deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch={{ grains["osarch"] }}] https://repo.saltproject.io/salt/py3/ubuntu/22.04/{{ grains["osarch"] }}/latest jammy main
39+
- file: /etc/apt/sources.list.d/salt.list
40+
- key_url: https://repo.saltproject.io/salt/py3/ubuntu/22.04/{{ grains["osarch"] }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg
41+
- aptkey: False
2742
{% else %}
2843
- name: deb http://archive.repo.saltstack.com/py3/ubuntu/{{ grains["osrelease"] }}/{{ grains["osarch"] }}/2018.3 {{ grains["oscodename"] }} main
2944
- key_url: https://archive.repo.saltstack.com/py3/ubuntu/18.04/amd64/2018.3/SALTSTACK-GPG-KEY.pub

salt/datadog/init.sls

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
datadog_repo:
22
pkgrepo.managed:
3-
- name: "deb https://apt.datadoghq.com stable 6"
3+
- name: "deb [signed-by=/etc/apt/keyrings/datadoghq.gpg arch={{ grains["osarch"] }}] https://apt.datadoghq.com stable 6"
44
- file: /etc/apt/sources.list.d/datadog.list
55
- key_url: salt://datadog/config/APT-GPG-KEY-DATADOG
6+
- aptkey: False
67
78
{% set in_datadog_tags = pillar.get('datadog_tags', []) + grains.get('datadog_tags', []) + grains.get('datadog_tags_from_metadata', []) %}
89
{% set datadog_tags = [] %}

salt/nginx/init.sls

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
nginx:
22
pkgrepo.managed:
3-
- name: deb http://nginx.org/packages/ubuntu {{ grains.oscodename }} nginx
3+
- name: deb [signed-by=/etc/apt/keyrings/nginx.gpg arch={{ grains["osarch"] }}] http://nginx.org/packages/ubuntu {{ grains.oscodename }} nginx
44
- file: /etc/apt/sources.list.d/nginx.list
55
- key_url: salt://nginx/config/APT-GPG-KEY-NGINX
6+
- aptkey: False
67
- order: 2
78
- require_in:
89
- pkg: nginx

0 commit comments

Comments
 (0)