Skip to content

Commit 7f2476c

Browse files
committed
chore(UNTESTED): attempt to support focal
1 parent d1c1921 commit 7f2476c

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
SERVERS = [
5+
# TODO: test focal salt repo changes
56
{:name => "backup-server", :codename => "noble"},
67
{:name => "bugs", :codename => "jammy", :ports => [8080]},
78
{:name => "buildbot", :codename => "noble"},

dockerfiles/Dockerfile.focal

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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:20.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-2024.pgp https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
51+
RUN echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2024.pgp arch=$(dpkg --print-architecture)] https://packages.broadcom.com/artifactory/saltproject-deb/ stable main" > /etc/apt/sources.list.d/salt.list
52+
53+
# Pin to Salt 3006 LTS
54+
RUN printf "Package: salt-*\nPin: version 3006.*\nPin-Priority: 1001\n" > /etc/apt/preferences.d/salt-pin-1001
55+
RUN apt-get update -y && apt-get install -y --no-install-recommends salt-minion
56+
57+
# Start Systemd (systemctl)
58+
CMD ["/lib/systemd/systemd"]

salt/base/salt.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ remove_old_salt_repo:
3535

3636
salt-repo:
3737
pkgrepo.managed:
38-
{% if grains["oscodename"] in ["jammy", "noble"] %}
38+
{% if grains["oscodename"] in ["focal", "jammy", "noble"] %}
3939
- name: deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2024.pgp arch={{ grains["osarch"] }}] https://packages.broadcom.com/artifactory/saltproject-deb/ stable main
4040
- key_url: https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
4141
- aptkey: False

0 commit comments

Comments
 (0)