Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate salt-master to Ubuntu 22.04('Jammy') #331

Merged
merged 11 commits into from
Jan 16, 2024
11 changes: 5 additions & 6 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SERVERS = [
"buildbot",
"cdn-logs",
"codespeed",
"consul",
{:name => "consul", :codename => "jammy"},
"docs",
"downloads",
"hg",
Expand Down Expand Up @@ -40,11 +40,10 @@ Vagrant.configure("2") do |config|
end

config.vm.define "salt-master" do |s_config|
# Uncomment below to migrate salt-master to jammy
# s_config.vm.provider "docker" do |docker, override|
# docker.build_dir = "dockerfiles"
# docker.dockerfile = "Dockerfile.jammy"
# end
s_config.vm.provider "docker" do |docker, override|
docker.build_dir = "dockerfiles"
docker.dockerfile = "Dockerfile.jammy"
end

s_config.vm.hostname = "salt-master.vagrant.psf.io"
s_config.vm.network "private_network", ip: MASTER1
Expand Down
2 changes: 2 additions & 0 deletions conf/vagrant/master.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ failhard: True

extension_modules: srv/salt/_extensions

user: root

pillar_roots:
base:
- /srv/pillar/dev
Expand Down
5 changes: 2 additions & 3 deletions dockerfiles/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ EXPOSE 22
RUN /usr/sbin/sshd

# Setup Salt Common

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
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
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
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
RUN apt-get update -y && apt-get install -y --no-install-recommends salt-minion

# Start Systemd (systemctl)
Expand Down
3 changes: 2 additions & 1 deletion salt/base/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

psf:
pkgrepo.managed:
- name: "deb https://packagecloud.io/psf/infra/ubuntu {{ grains['oscodename'] }} main"
- name: "deb [signed-by=/etc/apt/keyrings/packagecloud.gpg arch={{ grains["osarch"] }}] https://packagecloud.io/psf/infra/ubuntu {{ grains['oscodename'] }} main"
- file: /etc/apt/sources.list.d/psf.list
- key_url: salt://base/config/APT-GPG-KEY-PSF
- aptkey: False

# Make source list globally readable.
/etc/apt/sources.list.d/psf.list:
Expand Down
15 changes: 15 additions & 0 deletions salt/base/salt.sls
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ python-requests:
python-msgpack:
pkg.latest:
- name: python3-msgpack

{% elif grains["oscodename"] == "jammy" %}
python-requests:
pkg.latest:
- name: python3-requests

python-msgpack:
pkg.latest:
- name: python3-msgpack

{% else %}
python-requests:
pkg.latest
Expand All @@ -24,6 +34,11 @@ salt-2018.3:
{% if grains["oscodename"] == "focal" %}
- name: deb https://archive.repo.saltproject.io/py3/ubuntu/20.04/{{ grains["osarch"] }}/archive/3004 focal main
- key_url: https://archive.repo.saltproject.io/py3/ubuntu/20.04/{{ grains["osarch"] }}/archive/3004/salt-archive-keyring.gpg
{% elif grains["oscodename"] == "jammy" %}
- 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
- file: /etc/apt/sources.list.d/salt.list
- key_url: https://repo.saltproject.io/salt/py3/ubuntu/22.04/{{ grains["osarch"] }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg
ewdurbin marked this conversation as resolved.
Show resolved Hide resolved
- aptkey: False
{% else %}
- name: deb http://archive.repo.saltstack.com/py3/ubuntu/{{ grains["osrelease"] }}/{{ grains["osarch"] }}/2018.3 {{ grains["oscodename"] }} main
- key_url: https://archive.repo.saltstack.com/py3/ubuntu/18.04/amd64/2018.3/SALTSTACK-GPG-KEY.pub
Expand Down
3 changes: 2 additions & 1 deletion salt/datadog/init.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
datadog_repo:
pkgrepo.managed:
- name: "deb https://apt.datadoghq.com stable 6"
- name: "deb [signed-by=/etc/apt/keyrings/datadoghq.gpg arch={{ grains["osarch"] }}] https://apt.datadoghq.com stable 6"
- file: /etc/apt/sources.list.d/datadog.list
- key_url: salt://datadog/config/APT-GPG-KEY-DATADOG
- aptkey: False

{% set in_datadog_tags = pillar.get('datadog_tags', []) + grains.get('datadog_tags', []) + grains.get('datadog_tags_from_metadata', []) %}
{% set datadog_tags = [] %}
Expand Down
3 changes: 2 additions & 1 deletion salt/nginx/init.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
nginx:
pkgrepo.managed:
- name: deb http://nginx.org/packages/ubuntu {{ grains.oscodename }} nginx
- name: deb [signed-by=/etc/apt/keyrings/nginx.gpg arch={{ grains["osarch"] }}] http://nginx.org/packages/ubuntu {{ grains.oscodename }} nginx
- file: /etc/apt/sources.list.d/nginx.list
- key_url: salt://nginx/config/APT-GPG-KEY-NGINX
- aptkey: False
- order: 2
- require_in:
- pkg: nginx
Expand Down