Skip to content
Snippets Groups Projects
Commit 9981c5ec authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: add compatibility for Ubuntu 22.04 Jammy

parent 91a33ee3
No related branches found
No related tags found
No related merge requests found
...@@ -65,3 +65,28 @@ test-job-alma8: ...@@ -65,3 +65,28 @@ test-job-alma8:
- molecule idempotence --scenario-name ${SCENARIO} - molecule idempotence --scenario-name ${SCENARIO}
# - molecule verify --scenario-name ${SCENARIO} # - molecule verify --scenario-name ${SCENARIO}
- molecule destroy --scenario-name ${SCENARIO} - molecule destroy --scenario-name ${SCENARIO}
test-job-ubuntu2204:
stage: test
tags:
- "shell"
variables:
SCENARIO: "virtualbox_ubuntu2204"
script:
# make sure that Ansible Vaults are present and can be decrypted
- echo "${VAULT_INSTALL_COMMON}" > ../lza_install_common.pass
- export ANSIBLE_VAULT_PASSWORD_FILE=../lza_install_common.pass
- rm -rf ../ansible_vaults/
- git clone https://gitlab+deploy-token-25:${VAULT_ACCESS_TOKEN}@git.slub-dresden.de/slub-referat-2-3/ansible_vaults.git ../ansible_vaults/; \
# run Molecule tests
- molecule syntax --scenario-name ${SCENARIO}
# We cannot use `molecule lint` anymore because:
# - https://github.com/ansible-community/molecule/pull/3802 "Remove lint command"
# - https://github.com/ansible-community/molecule/discussions/3825#discussioncomment-4908366
- yamllint --strict --format colored ./
- ansible-lint --format full --profile production --strict --force-color ./
- molecule create --scenario-name ${SCENARIO}
- molecule converge --scenario-name ${SCENARIO}
- molecule idempotence --scenario-name ${SCENARIO}
# - molecule verify --scenario-name ${SCENARIO}
- molecule destroy --scenario-name ${SCENARIO}
...@@ -80,3 +80,6 @@ ...@@ -80,3 +80,6 @@
- name: update package cache # noqa no-changed-when - name: update package cache # noqa no-changed-when
ansible.builtin.package: ansible.builtin.package:
update_cache: true update_cache: true
- name: reboot
ansible.builtin.reboot:
...@@ -8,20 +8,33 @@ ...@@ -8,20 +8,33 @@
state: latest state: latest
update_cache: true update_cache: true
become: true become: true
- name: add custom repo for SLUB's custom Debian repo - name: Configure additional repos for Debian-based repos.
ansible.builtin.deb822_repository: when: ansible_os_family == "Debian"
architectures: "amd64" block:
components: "main" - name: >
enabled: true Set Mapping for Debian- and Ubuntu-Releasenames. This is necessary,
name: "slub" because SLUB's Debian repo server doesn't support Ubuntu releases
pdiffs: true (yet?). Whenever this restriction is removed, then we can remove
signed_by: "https://sdvdebianrepo.slub-dresden.de/deb-repository/pub.gpg.key" the mapping as well.
suites: "{{ ansible_lsb.codename }}" ansible.builtin.set_fact:
uris: "https://sdvdebianrepo.slub-dresden.de/deb-repository" releasenames:
notify: update apt cache jammy: "bookworm"
become: true # noble: "?????????"
- name: Add custom repo for SLUB's custom Debian repo.
ansible.builtin.deb822_repository:
architectures: "amd64"
components: "main"
enabled: true
name: "slub"
pdiffs: true
signed_by: "https://sdvdebianrepo.slub-dresden.de/deb-repository/pub.gpg.key"
# suites: "{{ ansible_lsb.codename }}"
suites: "{{ ( ansible_distribution == 'Ubuntu' ) | ternary( releasenames[ansible_lsb.codename], ansible_lsb.codename ) }}"
uris: "https://sdvdebianrepo.slub-dresden.de/deb-repository"
notify: update package cache
become: true
handlers: handlers:
- name: update apt cache - name: update package cache
ansible.builtin.apt: ansible.builtin.package:
update_cache: true update_cache: true
become: true become: true
---
dependency:
name: galaxy
enabled: false
driver:
name: vagrant
platforms:
# Check out the documentation at
# https://github.com/ansible-community/molecule-vagrant#documentation
# for more platform parameters.
- name: vm-runner-jammy
box: ubuntu/jammy64
memory: 1024
# List of raw Vagrant `config` options.
# provider_raw_config_args:
# - "customize [ 'modifyvm', :id, '--natdnshostresolver1', 'on' ]"
# Dictionary of `config` options.
config_options:
ssh.keep_alive: true
ssh.remote_user: "lza"
provisioner:
name: ansible
log: true
config_options:
defaults:
# https://stackoverflow.com/questions/57435811/ansible-molecule-pass-multiple-vault-ids
# vault_identity_list: "@$HOME/.ansible/roles/lza_install_common.pass, @$HOME/.ansible/roles/passfile_1.pass"
vault_identity_list: "../../../lza_install_common.pass"
display_skipped_hosts: false
display_ok_hosts: false
vvv: false
playbooks:
# create: ../resources/playbooks/create.yml
# destroy: ../resources/playbooks/destroy.yml
converge: ../resources/playbooks/converge.yml
prepare: ../resources/playbooks/prepare.yml
verify: ../resources/playbooks/verify.yml
verifier:
name: ansible
...@@ -6,6 +6,16 @@ ...@@ -6,6 +6,16 @@
ansible.builtin.package: ansible.builtin.package:
name: "zram-tools" name: "zram-tools"
state: latest state: latest
- name: configure zram based swap (Ubuntu)
ansible.builtin.package:
name: [ "linux-image-generic" ]
state: latest
when: ansible_distribution == "Ubuntu"
notify: reboot
- name: >
Reboot instantly if linux-modules-extra-*-generic were newly installed.
Otherwise, Ubuntu cannot load the zram.ko kernel module.
ansible.builtin.meta: flush_handlers
- name: configure zram - name: configure zram
ansible.builtin.blockinfile: ansible.builtin.blockinfile:
path: "/etc/default/zramswap" path: "/etc/default/zramswap"
......
...@@ -73,9 +73,32 @@ ...@@ -73,9 +73,32 @@
environment: environment:
NEEDRESTART_MODE: "automatically" NEEDRESTART_MODE: "automatically"
# Installation Debian-spezifische Pakete - name: Installation of Debian-specific packages
ansible.builtin.apt:
name: [
'linux-perf',
]
state: present
environment:
NEEDRESTART_MODE: "automatically"
when:
- ansible_os_family == "Debian"
- ansible_distribution == "Debian"
- name: Installation of Ubuntu-specific packages
ansible.builtin.apt:
name: [
'linux-tools-common',
]
state: present
environment:
NEEDRESTART_MODE: "automatically"
when:
- ansible_os_family == "Debian"
- ansible_distribution == "Ubuntu"
# lsb-release (uncodified dependency for open-vm-tools), nfs-common (contains lockd, statd, showmount, nfsstat, gssd, idmapd, mount.nfs), procps (contains tload) # lsb-release (uncodified dependency for open-vm-tools), nfs-common (contains lockd, statd, showmount, nfsstat, gssd, idmapd, mount.nfs), procps (contains tload)
- name: Installation Debian-spezifische Pakete - name: Install packages that are common to all Debian-based distributions.
ansible.builtin.apt: ansible.builtin.apt:
name: [ name: [
'acct', 'acct',
...@@ -89,7 +112,6 @@ ...@@ -89,7 +112,6 @@
'gpg', 'gpg',
'iptables-persistent', 'iptables-persistent',
'iptraf', 'iptraf',
'linux-perf',
'lsb-release', 'lsb-release',
'needrestart', 'needrestart',
'nfs-common', 'nfs-common',
...@@ -99,8 +121,6 @@ ...@@ -99,8 +121,6 @@
'procps', 'procps',
'iputils-tracepath', 'iputils-tracepath',
'ttyload', 'ttyload',
# https://www.pro-linux.de/news/1/26836/debian-10-bleibt-bei-der-migration-zu-usr.html
# 'usrmerge',
'vmtouch', 'vmtouch',
'vim' 'vim'
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment