Skip to content

Commit 727f4c6

Browse files
authored
feat: base support for noble (#382)
1 parent 6823e0a commit 727f4c6

File tree

6 files changed

+69
-6
lines changed

6 files changed

+69
-6
lines changed

dockerfiles/Dockerfile.noble

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Docker image to use with Vagrant
2+
# Aims to be as similar to normal Vagrant usage as possible
3+
# Adds SSH daemon, Systemd
4+
# Adapted from https://github.com/BashtonLtd/docker-vagrant-images/blob/master/ubuntu1404/Dockerfile
5+
6+
FROM ubuntu:24.04
7+
ENV container docker
8+
9+
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo $TZ > /etc/timezone
10+
11+
RUN apt-get update -y && apt-get dist-upgrade -y
12+
13+
# Install system dependencies, you may not need all of these
14+
RUN apt-get install -y --no-install-recommends ssh sudo libffi-dev systemd openssh-client wget gnupg-utils gnupg apt-utils ca-certificates dbus locales cron dialog rsyslog iproute2 logrotate
15+
16+
RUN locale-gen en_US.UTF-8
17+
COPY ./etc/locale.conf /etc/locale.conf
18+
ENV LANG en_US.UTF-8
19+
ENV LANGUAGE en_US:en
20+
ENV LC_ALL en_US.UTF-8
21+
22+
COPY ./etc/ssl/private/dhparams.pem /etc/ssl/private/dhparams.pem
23+
24+
# Install Vim
25+
RUN apt-get install -y vim
26+
27+
# Needed to run systemd
28+
# VOLUME [ "/sys/fs/cgroup" ]
29+
# Doesn't appear to be necessary? See comments
30+
31+
# Add vagrant user and key for SSH
32+
RUN useradd --create-home -s /bin/bash vagrant
33+
RUN echo -n 'vagrant:vagrant' | chpasswd
34+
RUN echo 'vagrant ALL = NOPASSWD: ALL' > /etc/sudoers.d/vagrant
35+
RUN chmod 440 /etc/sudoers.d/vagrant
36+
RUN mkdir -p /home/vagrant/.ssh
37+
RUN chmod 700 /home/vagrant/.ssh
38+
RUN echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==" > /home/vagrant/.ssh/authorized_keys
39+
RUN chmod 600 /home/vagrant/.ssh/authorized_keys
40+
RUN chown -R vagrant:vagrant /home/vagrant/.ssh
41+
RUN sed -i -e 's/Defaults.*requiretty/#&/' /etc/sudoers
42+
RUN sed -i -e 's/\(UsePAM \)yes/\1 no/' /etc/ssh/sshd_config
43+
44+
# Start SSH
45+
RUN mkdir /var/run/sshd
46+
EXPOSE 22
47+
RUN /usr/sbin/sshd
48+
49+
# Setup Salt Common
50+
RUN wget --quiet -O /etc/apt/keyrings/salt-archive-keyring.gpg https://repo.saltproject.io/salt/py3/ubuntu/24.04/$(dpkg --print-architecture)/SALT-PROJECT-GPG-PUBKEY-2023.gpg
51+
RUN echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://repo.saltproject.io/salt/py3/ubuntu/24.04/$(dpkg --print-architecture)/3007 noble main" > /etc/apt/sources.list.d/saltstack.list
52+
RUN apt-get update -y && apt-get install -y --no-install-recommends salt-minion
53+
54+
# Start Systemd (systemctl)
55+
CMD ["/lib/systemd/systemd"]

salt/base/config/sources.list.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{% set base_repo = "us.archive.ubuntu.com/ubuntu/" %}
55
{% endif %}
66

7+
{# 24.04 Noble is the first to use /etc/apt/sources.list.d/ubuntu.list instead of 'sources.list' #}
8+
{% if grains["oscodename"] != "noble" %}
79
###### Ubuntu Main Repos
810
deb http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe
911
deb-src http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe
@@ -13,3 +15,4 @@ deb http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted u
1315
deb http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe
1416
deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe
1517
deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe
18+
{% endif %}

salt/base/repo.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% if grains["oscodename"] == "jammy" %}
1+
{% if grains["oscodename"] in ["jammy", "noble"] %}
22
psfkey:
33
file.managed:
44
- name: /etc/apt/keyrings/packagecloud.asc

salt/base/salt.sls

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ python-msgpack:
77
pkg.latest:
88
- name: python3-msgpack
99

10-
{% elif grains["oscodename"] == "jammy" %}
10+
{% elif grains["oscodename"] in ["jammy", "noble"] %}
1111
python-requests:
1212
pkg.latest:
1313
- name: python3-requests
@@ -28,17 +28,22 @@ python3-pip:
2828
pkg.latest
2929

3030
{% if grains["os"] == "Ubuntu" %}
31-
salt-2018.3:
31+
salt-repo:
3232
pkgrepo.managed:
3333
- humanname: repo.saltstack.org
3434
{% if grains["oscodename"] == "focal" %}
3535
- name: deb https://archive.repo.saltproject.io/py3/ubuntu/20.04/{{ grains["osarch"] }}/archive/3004 focal main
3636
- key_url: https://archive.repo.saltproject.io/py3/ubuntu/20.04/{{ grains["osarch"] }}/archive/3004/salt-archive-keyring.gpg
3737
{% 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
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"] }}/3007 jammy main
3939
- file: /etc/apt/sources.list.d/salt.list
4040
- key_url: https://repo.saltproject.io/salt/py3/ubuntu/22.04/{{ grains["osarch"] }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg
4141
- aptkey: False
42+
{% elif grains["oscodename"] == "noble" %}
43+
- name: deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch={{ grains["osarch"] }}] https://repo.saltproject.io/salt/py3/ubuntu/24.04/{{ grains["osarch"] }}/3007 noble main
44+
- file: /etc/apt/sources.list.d/salt.list
45+
- key_url: https://repo.saltproject.io/salt/py3/ubuntu/24.04/{{ grains["osarch"] }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg
46+
- aptkey: False
4247
{% else %}
4348
- name: deb http://archive.repo.saltstack.com/py3/ubuntu/{{ grains["osrelease"] }}/{{ grains["osarch"] }}/2018.3 {{ grains["oscodename"] }} main
4449
- key_url: https://archive.repo.saltstack.com/py3/ubuntu/18.04/amd64/2018.3/SALTSTACK-GPG-KEY.pub

salt/nginx/init.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% if grains["oscodename"] == "jammy" %}
1+
{% if grains["oscodename"] in ["jammy", "noble"] %}
22
nginxkey:
33
file.managed:
44
- name: /etc/apt/keyrings/nginx.asc

salt/postgresql/base/init.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% if grains["oscodename"] == "jammy" %}
1+
{% if grains["oscodename"] in ["jammy", "noble"] %}
22
postgresql-key:
33
file.managed:
44
- name: /etc/apt/keyrings/postgresql.asc

0 commit comments

Comments
 (0)