Changeset - fefde7a74438
[Not reviewed]
0 5 0
Branko Majic (branko) - 2 months ago 2024-02-26 22:22:07
branko@majic.rs
MAR-192: Added support for Debian 12 Bookworm to common role:

- Use slightly more memory for Debian 12 Bookworm VMs, they have a
tendency to OOM otherwise (march of progress).
- Update regex for matching the DIR_MODE confiuration in Debian 12.
- Remove NTP pacakges if ntp_pools parameter was not set.
5 files changed with 58 insertions and 5 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -475,12 +475,13 @@ Parameters
 
Distribution compatibility
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
Role is compatible with the following distributions:
 

	
 
- Debian 11 (Bullseye)
 
- Debian 12 (Bookworm)
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
 
Here is an example configuration for setting-up some common users, groups, and
roles/common/meta/main.yml
Show inline comments
 
@@ -20,6 +20,7 @@ galaxy_info:
 
  license: BSD
 
  min_ansible_version: 2.9
 
  platforms:
 
    - name: Debian
 
      versions:
 
        - 11
 
        - 12
roles/common/molecule/default/molecule.yml
Show inline comments
 
@@ -11,13 +11,13 @@ lint:
 
  name: yamllint
 
  options:
 
    config-file: ../../.yamllint.yml
 

	
 
platforms:
 
  - name: helper
 
    box: debian/bullseye64
 
    box: debian/bookworm64
 
    memory: 512
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
@@ -31,13 +31,13 @@ platforms:
 
        type: static
 

	
 
  - name: client1
 
    groups:
 
      - client
 
      - client-allowed
 
    box: debian/bullseye64
 
    box: debian/bookworm64
 
    memory: 256
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
@@ -51,13 +51,13 @@ platforms:
 
        type: static
 

	
 
  - name: client2
 
    groups:
 
      - client
 
      - client-disallowed
 
    box: debian/bullseye64
 
    box: debian/bookworm64
 
    memory: 256
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
@@ -105,12 +105,50 @@ platforms:
 
      - auto_config: true
 
        ip: fd00::192:168:56:32
 
        network_name: private_network
 
        netmask: 116
 
        type: static
 

	
 
  - name: parameters-mandatory-bookworm
 
    groups:
 
      - parameters-mandatory
 
    box: debian/bookworm64
 
    memory: 384
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.21
 
        network_name: private_network
 
        type: static
 
      - auto_config: true
 
        ip: fd00::192:168:56:21
 
        network_name: private_network
 
        netmask: 116
 
        type: static
 

	
 
  - name: parameters-optional-bookworm
 
    groups:
 
      - parameters-optional
 
    box: debian/bookworm64
 
    memory: 384
 
    cpus: 1
 
    provider_raw_config_args:
 
      - "customize ['modifyvm', :id, '--paravirtprovider', 'minimal']"
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.22
 
        network_name: private_network
 
        type: static
 
      - auto_config: true
 
        ip: fd00::192:168:56:22
 
        network_name: private_network
 
        netmask: 116
 
        type: static
 

	
 
provisioner:
 
  name: ansible
 
  playbooks:
 
    cleanup: cleanup.yml
 
  config_options:
 
    defaults:
roles/common/molecule/default/prepare.yml
Show inline comments
 
@@ -71,12 +71,16 @@
 
        state: present
 
      with_dict:
 
        192.168.56.31: parameters-mandatory-bullseye
 
        192.168.56.32: parameters-optional-bullseye
 
        fd00::192:168:56:31: parameters-mandatory-bullseye
 
        fd00::192:168:56:32: parameters-optional-bullseye
 
        192.168.56.21: parameters-mandatory-bookworm
 
        192.168.56.22: parameters-optional-bookworm
 
        fd00::192:168:56:21: parameters-mandatory-bookworm
 
        fd00::192:168:56:22: parameters-optional-bookworm
 

	
 
- hosts: parameters-mandatory,parameters-optional
 
  become: true
 
  tasks:
 

	
 
    - name: Set-up /etc/hosts with entries for all servers
roles/common/tasks/main.yml
Show inline comments
 
@@ -58,13 +58,13 @@
 

	
 
- name: Set home directory mask
 
  lineinfile:
 
    dest: "/etc/adduser.conf"
 
    state: present
 
    backrefs: true
 
    regexp: '^DIR_MODE='
 
    regexp: '^\s*#?\s*DIR_MODE='
 
    line: 'DIR_MODE=0750'
 

	
 
- name: Deploy bash profile configuration for fancier prompts
 
  template:
 
    src: "bash_prompt.sh.j2"
 
    dest: "/etc/profile.d/bash_prompt.sh"
 
@@ -100,13 +100,13 @@
 
  copy:
 
    src: "skel_bashrc"
 
    dest: "/root/.bashrc"
 
    owner: root
 
    group: root
 
    mode: 0640
 
  # Checksums: bullseye
 
  # Checksums: bullseye and bookworm (same)
 
  when: |
 
    root_bashrc_stat.stat.checksum == "1a422a148ad225aa5ba33f8dafd2b7cfcdbd701f"
 

	
 
- name: Install sudo
 
  apt:
 
    name: sudo
 
@@ -480,12 +480,21 @@
 
    name:
 
      - ntpsec
 
      - ntpsec-ntpdate
 
    state: present
 
  when: ntp_pools | length > 0
 

	
 
- name: Remove NTP packages
 
  apt:
 
    name:
 
      - ntpsec
 
      - ntpsec-ntpdate
 
    state: absent
 
    purge: true
 
  when: ntp_pools | length == 0
 

	
 
- name: Deploy NTP configuration
 
  template:
 
    src: "ntp.conf.j2"
 
    dest: "/etc/ntpsec/ntp.conf"
 
    owner: root
 
    group: root
0 comments (0 inline, 0 general)