From d6e9a82a72126ef73c6aaa05031ae1a0b991b87e Mon Sep 17 00:00:00 2001 From: Bodo Schulz Date: Tue, 20 Aug 2024 06:49:40 +0200 Subject: [PATCH] update workflows and molecule configs --- .github/workflows/icinga2.yml | 5 +- .github/workflows/icingadb.yml | 41 ++++---- .github/workflows/icingaweb2.yml | 99 +++++++++++++++---- .github/workflows/icingaweb2_modules.yml | 61 +----------- .github/workflows/icingaweb2_themes.yml | 61 +----------- .github/workflows/linter.yml | 2 +- roles/icingadb/molecule/default/molecule.yml | 8 +- roles/icingadb/molecule/default/prepare.yml | 12 ++- .../molecule/default/requirements.yml | 14 +-- .../icingaweb2/molecule/default/molecule.yml | 6 +- roles/icingaweb2/molecule/default/prepare.yml | 12 ++- .../molecule/default/requirements.yml | 12 +-- .../molecule/update_2.7.0-2.11.3/molecule.yml | 6 +- .../molecule/update_2.7.0-2.8.2/molecule.yml | 4 +- .../molecule/with-icingadb/molecule.yml | 29 ++++-- .../molecule/with-icingadb/prepare.yml | 11 +++ .../molecule/with-icingadb/requirements.yml | 28 +++--- .../molecule/with-update/molecule.yml | 20 +++- .../molecule/with-update/prepare.yml | 19 ++-- .../molecule/with-update/requirements.yml | 24 ++--- .../molecule/default/molecule.yml | 4 +- .../molecule/default/prepare.yml | 12 ++- .../molecule/default/requirements.yml | 20 ++-- .../molecule/default/molecule.yml | 10 +- .../molecule/default/prepare.yml | 12 ++- .../molecule/default/requirements.yml | 26 ++--- 26 files changed, 271 insertions(+), 287 deletions(-) diff --git a/.github/workflows/icinga2.yml b/.github/workflows/icinga2.yml index f125a86..8454533 100644 --- a/.github/workflows/icinga2.yml +++ b/.github/workflows/icinga2.yml @@ -25,8 +25,7 @@ on: - "!README.md" - 'roles/icinga2/**' - '.github/workflows/icinga2.yml' - - '.config/ansible-lint.yml' - - '.yamllint' + pull_request: branches: - 'main' @@ -38,8 +37,6 @@ on: - "!README.md" - 'roles/icinga2/**' - '.github/workflows/icinga2.yml' - - '.config/ansible-lint.yml' - - '.yamllint' env: COLLECTION_NAMESPACE: bodsch diff --git a/.github/workflows/icingadb.yml b/.github/workflows/icingadb.yml index 151bdb0..c84cce9 100644 --- a/.github/workflows/icingadb.yml +++ b/.github/workflows/icingadb.yml @@ -25,8 +25,7 @@ on: - "!README.md" - 'roles/icingadb/**' - '.github/workflows/icingadb.yml' - - '.config/ansible-lint.yml' - - '.yamllint' + pull_request: branches: - 'main' @@ -38,8 +37,6 @@ on: - "!README.md" - 'roles/icingadb/**' - '.github/workflows/icingadb.yml' - - '.config/ansible-lint.yml' - - '.yamllint' env: COLLECTION_NAMESPACE: bodsch @@ -48,14 +45,14 @@ env: ANSIBLE_FORCE_COLOR: '1' jobs: - arch: + debian: name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: image: - - archlinux:latest + - debian:12 ansible-version: - '8.5' python_version: @@ -69,8 +66,6 @@ jobs: steps: - name: check out the codebase. uses: actions/checkout@v4 - with: - ref: ${{ github.event.workflow_run.head_branch }} - name: 🐍 set up python uses: actions/setup-python@v5 @@ -82,6 +77,15 @@ jobs: python -m pip install --upgrade pip pip install -r test-requirements.txt + - name: force reinstall of community.docker + run: | + mkdir -p /home/runner/.ansible/collections + ansible-galaxy collection install community.docker --force + + - name: teardown apparmor + run: | + if [ -e /usr/sbin/aa-teardown ]; then /usr/sbin/aa-teardown; fi + - name: Install collection run: | make \ @@ -95,19 +99,15 @@ jobs: -e DISTRIBUTION="${{ matrix.image }}" \ -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} - debian: + ubuntu: name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: image: - - debian:12 + - ubuntu:22.04 ansible-version: - '8.5' python_version: @@ -132,6 +132,15 @@ jobs: python -m pip install --upgrade pip pip install -r test-requirements.txt + - name: force reinstall of community.docker + run: | + mkdir -p /home/runner/.ansible/collections + ansible-galaxy collection install community.docker --force + + - name: teardown apparmor + run: | + if [ -e /usr/sbin/aa-teardown ]; then /usr/sbin/aa-teardown; fi + - name: Install collection run: | make \ @@ -145,7 +154,3 @@ jobs: -e DISTRIBUTION="${{ matrix.image }}" \ -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} diff --git a/.github/workflows/icingaweb2.yml b/.github/workflows/icingaweb2.yml index 20f71a7..f11701d 100644 --- a/.github/workflows/icingaweb2.yml +++ b/.github/workflows/icingaweb2.yml @@ -25,8 +25,7 @@ on: - "!README.md" - 'roles/icingaweb2/**' - '.github/workflows/icingaweb2.yml' - - '.config/ansible-lint.yml' - - '.yamllint' + pull_request: branches: - 'main' @@ -38,8 +37,6 @@ on: - "!README.md" - 'roles/icingaweb2/**' - '.github/workflows/icingaweb2.yml' - - '.config/ansible-lint.yml' - - '.yamllint' env: COLLECTION_NAMESPACE: bodsch @@ -48,14 +45,15 @@ env: ANSIBLE_FORCE_COLOR: '1' jobs: - arch: + + debian: name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: image: - - archlinux:latest + - debian:12 ansible-version: - '8.5' python_version: @@ -69,8 +67,61 @@ jobs: steps: - name: check out the codebase. uses: actions/checkout@v4 + + - name: 🐍 set up python + uses: actions/setup-python@v5 with: - ref: ${{ github.event.workflow_run.head_branch }} + python-version: "${{ matrix.python_version }}" + + - name: install dependencies + run: | + python -m pip install --upgrade pip + pip install -r test-requirements.txt + + - name: force reinstall of community.docker + run: | + mkdir -p /home/runner/.ansible/collections + ansible-galaxy collection install community.docker --force + + - name: teardown apparmor + run: | + if [ -e /usr/sbin/aa-teardown ]; then /usr/sbin/aa-teardown; fi + + - name: Install collection + run: | + make \ + install + + - name: test ${{ matrix.collection_role }} - ${{ matrix.scenario }} + run: | + make \ + test \ + -e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \ + -e DISTRIBUTION="${{ matrix.image }}" \ + -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ + -e COLLECTION_SCENARIO="${{ matrix.scenario }}" + + ubuntu: + name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + image: + - ubuntu:22.04 + ansible-version: + - '8.5' + python_version: + - "3.10" + - "3.11" + scenario: + - default + collection_role: + - icingaweb2 + + steps: + - name: check out the codebase. + uses: actions/checkout@v4 - name: 🐍 set up python uses: actions/setup-python@v5 @@ -82,6 +133,15 @@ jobs: python -m pip install --upgrade pip pip install -r test-requirements.txt + - name: force reinstall of community.docker + run: | + mkdir -p /home/runner/.ansible/collections + ansible-galaxy collection install community.docker --force + + - name: teardown apparmor + run: | + if [ -e /usr/sbin/aa-teardown ]; then /usr/sbin/aa-teardown; fi + - name: Install collection run: | make \ @@ -95,14 +155,12 @@ jobs: -e DISTRIBUTION="${{ matrix.image }}" \ -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} - debian: + scenarios: name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" runs-on: ubuntu-22.04 + needs: + - debian strategy: fail-fast: false matrix: @@ -114,7 +172,9 @@ jobs: - "3.10" - "3.11" scenario: - - default + - with-update + - with-icingadb + - update_2.7.0-2.11.3 collection_role: - icingaweb2 @@ -132,6 +192,15 @@ jobs: python -m pip install --upgrade pip pip install -r test-requirements.txt + - name: force reinstall of community.docker + run: | + mkdir -p /home/runner/.ansible/collections + ansible-galaxy collection install community.docker --force + + - name: teardown apparmor + run: | + if [ -e /usr/sbin/aa-teardown ]; then /usr/sbin/aa-teardown; fi + - name: Install collection run: | make \ @@ -145,7 +214,3 @@ jobs: -e DISTRIBUTION="${{ matrix.image }}" \ -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} diff --git a/.github/workflows/icingaweb2_modules.yml b/.github/workflows/icingaweb2_modules.yml index a1f4b4f..440d2cb 100644 --- a/.github/workflows/icingaweb2_modules.yml +++ b/.github/workflows/icingaweb2_modules.yml @@ -25,8 +25,7 @@ on: - "!README.md" - 'roles/icingaweb2_modules/**' - '.github/workflows/icingaweb2_modules.yml' - - '.config/ansible-lint.yml' - - '.yamllint' + pull_request: branches: - 'main' @@ -38,8 +37,6 @@ on: - "!README.md" - 'roles/icingaweb2_modules/**' - '.github/workflows/icingaweb2_modules.yml' - - '.config/ansible-lint.yml' - - '.yamllint' env: COLLECTION_NAMESPACE: bodsch @@ -48,58 +45,6 @@ env: ANSIBLE_FORCE_COLOR: '1' jobs: - arch: - name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - image: - - archlinux:latest - ansible-version: - - '8.5' - python_version: - - "3.10" - - "3.11" - scenario: - - default - collection_role: - - icingaweb2_modules - - steps: - - name: check out the codebase. - uses: actions/checkout@v4 - with: - ref: ${{ github.event.workflow_run.head_branch }} - - - name: 🐍 set up python - uses: actions/setup-python@v5 - with: - python-version: "${{ matrix.python_version }}" - - - name: install dependencies - run: | - python -m pip install --upgrade pip - pip install -r test-requirements.txt - - - name: Install collection - run: | - make \ - install - - - name: test ${{ matrix.collection_role }} - ${{ matrix.scenario }} - run: | - make \ - test \ - -e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \ - -e DISTRIBUTION="${{ matrix.image }}" \ - -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ - -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} - debian: name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" runs-on: ubuntu-22.04 @@ -145,7 +90,3 @@ jobs: -e DISTRIBUTION="${{ matrix.image }}" \ -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} diff --git a/.github/workflows/icingaweb2_themes.yml b/.github/workflows/icingaweb2_themes.yml index 72b784c..2816cfc 100644 --- a/.github/workflows/icingaweb2_themes.yml +++ b/.github/workflows/icingaweb2_themes.yml @@ -25,8 +25,7 @@ on: - "!README.md" - 'roles/icingaweb2_themes/**' - '.github/workflows/icingaweb2_themes.yml' - - '.config/ansible-lint.yml' - - '.yamllint' + pull_request: branches: - 'main' @@ -38,8 +37,6 @@ on: - "!README.md" - 'roles/icingaweb2_themes/**' - '.github/workflows/icingaweb2_themes.yml' - - '.config/ansible-lint.yml' - - '.yamllint' env: COLLECTION_NAMESPACE: bodsch @@ -48,58 +45,6 @@ env: ANSIBLE_FORCE_COLOR: '1' jobs: - arch: - name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - image: - - archlinux:latest - ansible-version: - - '8.5' - python_version: - - "3.10" - - "3.11" - scenario: - - default - collection_role: - - icingaweb2_themes - - steps: - - name: check out the codebase. - uses: actions/checkout@v4 - with: - ref: ${{ github.event.workflow_run.head_branch }} - - - name: 🐍 set up python - uses: actions/setup-python@v5 - with: - python-version: "${{ matrix.python_version }}" - - - name: install dependencies - run: | - python -m pip install --upgrade pip - pip install -r test-requirements.txt - - - name: Install collection - run: | - make \ - install - - - name: test ${{ matrix.collection_role }} - ${{ matrix.scenario }} - run: | - make \ - test \ - -e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \ - -e DISTRIBUTION="${{ matrix.image }}" \ - -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ - -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} - debian: name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}" runs-on: ubuntu-22.04 @@ -145,7 +90,3 @@ jobs: -e DISTRIBUTION="${{ matrix.image }}" \ -e COLLECTION_ROLE="${{ matrix.collection_role }}" \ -e COLLECTION_SCENARIO="${{ matrix.scenario }}" - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - DISTRIBUTION: ${{ matrix.image }} diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 8d7bdb2..a0f706a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -44,7 +44,7 @@ jobs: python_version: - "3.10" - "3.11" - - "3.13" + - "3.12" steps: - name: Check out the codebase. diff --git a/roles/icingadb/molecule/default/molecule.yml b/roles/icingadb/molecule/default/molecule.yml index 1066ceb..3af8cea 100644 --- a/roles/icingadb/molecule/default/molecule.yml +++ b/roles/icingadb/molecule/default/molecule.yml @@ -5,15 +5,9 @@ dependency: driver: name: docker -lint: | - set -e - yamllint . - ansible-lint . - flake8 . - platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true diff --git a/roles/icingadb/molecule/default/prepare.yml b/roles/icingadb/molecule/default/prepare.yml index 66676b2..26d1758 100644 --- a/roles/icingadb/molecule/default/prepare.yml +++ b/roles/icingadb/molecule/default/prepare.yml @@ -13,6 +13,9 @@ - name: update pacman system ansible.builtin.command: | pacman --refresh --sync --sysupgrade --noconfirm + register: pacman + changed_when: pacman.rc != 0 + failed_when: pacman.rc != 0 - name: create depends service ansible.builtin.copy: @@ -24,6 +27,14 @@ when: - ansible_os_family | lower == 'artix linux' + - name: make sure python3-apt is installed (only debian based) + ansible.builtin.package: + name: + - python3-apt + state: present + when: + - ansible_os_family | lower == 'debian' + - name: update package cache become: true ansible.builtin.package: @@ -42,7 +53,6 @@ gather_facts: true roles: - - role: apparmor - role: snapd - role: mariadb diff --git a/roles/icingadb/molecule/default/requirements.yml b/roles/icingadb/molecule/default/requirements.yml index 1039f38..72b919a 100644 --- a/roles/icingadb/molecule/default/requirements.yml +++ b/roles/icingadb/molecule/default/requirements.yml @@ -2,22 +2,18 @@ - name: snapd src: https://github.com/bodsch/ansible-snapd - version: 1.2.2 - -- name: apparmor - src: https://github.com/bodsch/ansible-apparmor - version: 2.0.0 + version: 1.3.1 - name: monitoring-tools src: https://github.com/bodsch/ansible-monitoring-plugins - version: 1.4.2 + version: 1.5.0 - name: mariadb src: https://github.com/bodsch/ansible-mariadb - version: 2.4.1 + version: 2.5.0 - name: redis - src: bodsch.redis - version: 1.4.0 + src: https://github.com/bodsch/ansible-redis + version: 1.4.1 ... diff --git a/roles/icingaweb2/molecule/default/molecule.yml b/roles/icingaweb2/molecule/default/molecule.yml index c77661f..e255cbe 100644 --- a/roles/icingaweb2/molecule/default/molecule.yml +++ b/roles/icingaweb2/molecule/default/molecule.yml @@ -7,7 +7,7 @@ driver: platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true @@ -31,7 +31,7 @@ platforms: ipv4_address: "10.11.0.1" # - name: icinga2 - # image: "bodsch/ansible-debian:11" + # image: "bodsch/ansible-debian:12" # command: ${MOLECULE_DOCKER_COMMAND:-""} # docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" # privileged: true @@ -45,7 +45,7 @@ platforms: # ipv4_address: "10.11.0.2" - name: instance - image: "bodsch/ansible-${DISTRIBUTION:-debian:11}" + image: "bodsch/ansible-${DISTRIBUTION:-debian:12}" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true diff --git a/roles/icingaweb2/molecule/default/prepare.yml b/roles/icingaweb2/molecule/default/prepare.yml index 8352325..ae8b9af 100644 --- a/roles/icingaweb2/molecule/default/prepare.yml +++ b/roles/icingaweb2/molecule/default/prepare.yml @@ -13,6 +13,9 @@ - name: update pacman system ansible.builtin.command: | pacman --refresh --sync --sysupgrade --noconfirm + register: pacman + changed_when: pacman.rc != 0 + failed_when: pacman.rc != 0 - name: create depends service ansible.builtin.copy: @@ -24,6 +27,14 @@ when: - ansible_os_family | lower == 'artix linux' + - name: make sure python3-apt is installed (only debian based) + ansible.builtin.package: + name: + - python3-apt + state: present + when: + - ansible_os_family | lower == 'debian' + - name: update package cache become: true ansible.builtin.package: @@ -42,7 +53,6 @@ gather_facts: true roles: - - role: apparmor - role: snapd - role: mariadb diff --git a/roles/icingaweb2/molecule/default/requirements.yml b/roles/icingaweb2/molecule/default/requirements.yml index 12c3cb5..34de3b0 100644 --- a/roles/icingaweb2/molecule/default/requirements.yml +++ b/roles/icingaweb2/molecule/default/requirements.yml @@ -2,22 +2,18 @@ - name: snapd src: https://github.com/bodsch/ansible-snapd - version: 1.2.2 - -- name: apparmor - src: https://github.com/bodsch/ansible-apparmor - version: 2.0.0 + version: 1.3.1 - name: php-fpm src: https://github.com/bodsch/ansible-php - version: 2.2.0 + version: 2.3.0 - name: nginx src: https://github.com/bodsch/ansible-nginx - version: 0.25.0 + version: 0.27.1 - name: mariadb src: https://github.com/bodsch/ansible-mariadb - version: 2.4.1 + version: 2.5.0 ... diff --git a/roles/icingaweb2/molecule/update_2.7.0-2.11.3/molecule.yml b/roles/icingaweb2/molecule/update_2.7.0-2.11.3/molecule.yml index b2f4da5..f0e5610 100644 --- a/roles/icingaweb2/molecule/update_2.7.0-2.11.3/molecule.yml +++ b/roles/icingaweb2/molecule/update_2.7.0-2.11.3/molecule.yml @@ -7,7 +7,7 @@ driver: platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true @@ -26,7 +26,7 @@ platforms: ipv4_address: "10.11.0.1" # - name: icinga2 - # image: "bodsch/ansible-debian:11" + # image: "bodsch/ansible-debian:12" # command: ${MOLECULE_DOCKER_COMMAND:-""} # docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" # privileged: true @@ -40,7 +40,7 @@ platforms: # ipv4_address: "10.11.0.2" - name: instance - image: "bodsch/ansible-${DISTRIBUTION:-debian:11}" + image: "bodsch/ansible-${DISTRIBUTION:-debian:12}" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true diff --git a/roles/icingaweb2/molecule/update_2.7.0-2.8.2/molecule.yml b/roles/icingaweb2/molecule/update_2.7.0-2.8.2/molecule.yml index b0a284a..e255cbe 100644 --- a/roles/icingaweb2/molecule/update_2.7.0-2.8.2/molecule.yml +++ b/roles/icingaweb2/molecule/update_2.7.0-2.8.2/molecule.yml @@ -7,7 +7,7 @@ driver: platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true @@ -31,7 +31,7 @@ platforms: ipv4_address: "10.11.0.1" # - name: icinga2 - # image: "bodsch/ansible-debian:11" + # image: "bodsch/ansible-debian:12" # command: ${MOLECULE_DOCKER_COMMAND:-""} # docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" # privileged: true diff --git a/roles/icingaweb2/molecule/with-icingadb/molecule.yml b/roles/icingaweb2/molecule/with-icingadb/molecule.yml index d959dea..1f8607e 100644 --- a/roles/icingaweb2/molecule/with-icingadb/molecule.yml +++ b/roles/icingaweb2/molecule/with-icingadb/molecule.yml @@ -7,13 +7,18 @@ driver: platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true pre_build_image: true + cgroupns_mode: host volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - /var/lib/containerd + tmpfs: + - /run + - /tmp groups: - database docker_networks: @@ -26,19 +31,24 @@ platforms: ipv4_address: "10.11.0.10" - name: icingadb - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true pre_build_image: true + cgroupns_mode: host volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - /var/lib/containerd + tmpfs: + - /run + - /tmp networks: - name: icinga ipv4_address: "10.11.0.11" # - name: icinga2 - # image: "bodsch/ansible-debian:11" + # image: "bodsch/ansible-debian:12" # command: ${MOLECULE_DOCKER_COMMAND:-""} # docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" # privileged: true @@ -52,13 +62,18 @@ platforms: # ipv4_address: "10.11.0.15" - name: instance - image: "bodsch/ansible-${DISTRIBUTION:-debian:11}" + image: "bodsch/ansible-${DISTRIBUTION:-debian:12}" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true pre_build_image: true + cgroupns_mode: host volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - /var/lib/containerd + tmpfs: + - /run + - /tmp published_ports: - 80:80 networks: diff --git a/roles/icingaweb2/molecule/with-icingadb/prepare.yml b/roles/icingaweb2/molecule/with-icingadb/prepare.yml index 6bec049..e6345ec 100644 --- a/roles/icingaweb2/molecule/with-icingadb/prepare.yml +++ b/roles/icingaweb2/molecule/with-icingadb/prepare.yml @@ -13,6 +13,9 @@ - name: update pacman system ansible.builtin.command: | pacman --refresh --sync --sysupgrade --noconfirm + register: pacman + changed_when: pacman.rc != 0 + failed_when: pacman.rc != 0 - name: create depends service ansible.builtin.copy: @@ -24,6 +27,14 @@ when: - ansible_os_family | lower == 'artix linux' + - name: make sure python3-apt is installed (only debian based) + ansible.builtin.package: + name: + - python3-apt + state: present + when: + - ansible_os_family | lower == 'debian' + - name: update package cache become: true ansible.builtin.package: diff --git a/roles/icingaweb2/molecule/with-icingadb/requirements.yml b/roles/icingaweb2/molecule/with-icingadb/requirements.yml index 9493de3..01fff9c 100644 --- a/roles/icingaweb2/molecule/with-icingadb/requirements.yml +++ b/roles/icingaweb2/molecule/with-icingadb/requirements.yml @@ -1,27 +1,23 @@ --- - name: snapd - src: bodsch.snapd - version: 1.3.0 - -- name: apparmor - src: bodsch.apparmor - version: 2.0.0 + src: https://github.com/bodsch/ansible-snapd + version: 1.3.1 - name: php-fpm - src: bodsch.php - version: 2.2.0 - -- name: mariadb - src: bodsch.mariadb - version: 2.4.1 + src: https://github.com/bodsch/ansible-php + version: 2.3.0 - name: nginx - src: bodsch.nginx - version: 0.25.1 + src: https://github.com/bodsch/ansible-nginx + version: 0.27.1 + +- name: mariadb + src: https://github.com/bodsch/ansible-mariadb + version: 2.5.0 - name: redis - src: bodsch.redis - version: 1.4.0 + src: https://github.com/bodsch/ansible-redis + version: 1.4.1 ... diff --git a/roles/icingaweb2/molecule/with-update/molecule.yml b/roles/icingaweb2/molecule/with-update/molecule.yml index b2f4da5..e255cbe 100644 --- a/roles/icingaweb2/molecule/with-update/molecule.yml +++ b/roles/icingaweb2/molecule/with-update/molecule.yml @@ -7,13 +7,18 @@ driver: platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true pre_build_image: true + cgroupns_mode: host volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - /var/lib/containerd + tmpfs: + - /run + - /tmp groups: - database docker_networks: @@ -26,7 +31,7 @@ platforms: ipv4_address: "10.11.0.1" # - name: icinga2 - # image: "bodsch/ansible-debian:11" + # image: "bodsch/ansible-debian:12" # command: ${MOLECULE_DOCKER_COMMAND:-""} # docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" # privileged: true @@ -40,13 +45,18 @@ platforms: # ipv4_address: "10.11.0.2" - name: instance - image: "bodsch/ansible-${DISTRIBUTION:-debian:11}" + image: "bodsch/ansible-${DISTRIBUTION:-debian:12}" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true pre_build_image: true + cgroupns_mode: host volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - /var/lib/containerd + tmpfs: + - /run + - /tmp published_ports: - 80:80 networks: diff --git a/roles/icingaweb2/molecule/with-update/prepare.yml b/roles/icingaweb2/molecule/with-update/prepare.yml index 9bf2227..ae8b9af 100644 --- a/roles/icingaweb2/molecule/with-update/prepare.yml +++ b/roles/icingaweb2/molecule/with-update/prepare.yml @@ -13,6 +13,9 @@ - name: update pacman system ansible.builtin.command: | pacman --refresh --sync --sysupgrade --noconfirm + register: pacman + changed_when: pacman.rc != 0 + failed_when: pacman.rc != 0 - name: create depends service ansible.builtin.copy: @@ -24,6 +27,14 @@ when: - ansible_os_family | lower == 'artix linux' + - name: make sure python3-apt is installed (only debian based) + ansible.builtin.package: + name: + - python3-apt + state: present + when: + - ansible_os_family | lower == 'debian' + - name: update package cache become: true ansible.builtin.package: @@ -37,19 +48,11 @@ - "ansible version : {{ ansible_version.full }}" - "python version : {{ ansible_python.version.major }}.{{ ansible_python.version.minor }}" -# - name: prepare all containers -# hosts: all -# gather_facts: true -# -# roles: -# - role: monitoring-tools - - name: prepare database container hosts: database gather_facts: true roles: - - role: apparmor - role: snapd - role: mariadb diff --git a/roles/icingaweb2/molecule/with-update/requirements.yml b/roles/icingaweb2/molecule/with-update/requirements.yml index 35ba78a..34de3b0 100644 --- a/roles/icingaweb2/molecule/with-update/requirements.yml +++ b/roles/icingaweb2/molecule/with-update/requirements.yml @@ -1,23 +1,19 @@ --- - name: snapd - src: bodsch.snapd - version: 1.3.0 - -- name: apparmor - src: bodsch.apparmor - version: 2.0.0 + src: https://github.com/bodsch/ansible-snapd + version: 1.3.1 - name: php-fpm - src: bodsch.php - version: 2.2.0 - -- name: mariadb - src: bodsch.mariadb - version: 2.4.1 + src: https://github.com/bodsch/ansible-php + version: 2.3.0 - name: nginx - src: bodsch.nginx - version: 0.25.1 + src: https://github.com/bodsch/ansible-nginx + version: 0.27.1 + +- name: mariadb + src: https://github.com/bodsch/ansible-mariadb + version: 2.5.0 ... diff --git a/roles/icingaweb2_modules/molecule/default/molecule.yml b/roles/icingaweb2_modules/molecule/default/molecule.yml index 1d5f6bd..49135ea 100644 --- a/roles/icingaweb2_modules/molecule/default/molecule.yml +++ b/roles/icingaweb2_modules/molecule/default/molecule.yml @@ -7,7 +7,7 @@ driver: platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true @@ -45,7 +45,7 @@ platforms: # ipv4_address: "10.11.0.2" - name: instance - image: "bodsch/ansible-${DISTRIBUTION:-debian:11}" + image: "bodsch/ansible-${DISTRIBUTION:-debian:12}" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true diff --git a/roles/icingaweb2_modules/molecule/default/prepare.yml b/roles/icingaweb2_modules/molecule/default/prepare.yml index 18d0a99..9f86ef4 100644 --- a/roles/icingaweb2_modules/molecule/default/prepare.yml +++ b/roles/icingaweb2_modules/molecule/default/prepare.yml @@ -13,6 +13,9 @@ - name: update pacman system ansible.builtin.command: | pacman --refresh --sync --sysupgrade --noconfirm + register: pacman + changed_when: pacman.rc != 0 + failed_when: pacman.rc != 0 - name: create depends service ansible.builtin.copy: @@ -24,6 +27,14 @@ when: - ansible_os_family | lower == 'artix linux' + - name: make sure python3-apt is installed (only debian based) + ansible.builtin.package: + name: + - python3-apt + state: present + when: + - ansible_os_family | lower == 'debian' + - name: update package cache become: true ansible.builtin.package: @@ -51,7 +62,6 @@ gather_facts: true roles: - - role: apparmor - role: snapd - role: mariadb diff --git a/roles/icingaweb2_modules/molecule/default/requirements.yml b/roles/icingaweb2_modules/molecule/default/requirements.yml index bcd6743..b16b54f 100644 --- a/roles/icingaweb2_modules/molecule/default/requirements.yml +++ b/roles/icingaweb2_modules/molecule/default/requirements.yml @@ -2,26 +2,22 @@ - name: snapd src: https://github.com/bodsch/ansible-snapd - version: 1.2.2 - -- name: apparmor - src: https://github.com/bodsch/ansible-apparmor - version: 2.0.0 + version: 1.3.1 - name: php-fpm src: https://github.com/bodsch/ansible-php - version: 2.2.0 + version: 2.3.0 - name: nginx src: https://github.com/bodsch/ansible-nginx - version: 0.25.0 - -- name: monitoring-tools - src: https://github.com/bodsch/ansible-monitoring-plugins - version: 1.4.2 + version: 0.27.1 - name: mariadb src: https://github.com/bodsch/ansible-mariadb - version: 2.4.1 + version: 2.5.0 + +- name: monitoring-tools + src: https://github.com/bodsch/ansible-monitoring-plugins + version: 1.5.0 ... diff --git a/roles/icingaweb2_themes/molecule/default/molecule.yml b/roles/icingaweb2_themes/molecule/default/molecule.yml index 0b6ae7a..2d20c56 100644 --- a/roles/icingaweb2_themes/molecule/default/molecule.yml +++ b/roles/icingaweb2_themes/molecule/default/molecule.yml @@ -5,15 +5,9 @@ dependency: driver: name: docker -#lint: | -# set -e -# yamllint . -# ansible-lint . -# flake8 . - platforms: - name: database - image: "bodsch/ansible-debian:11" + image: "bodsch/ansible-debian:12" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true @@ -51,7 +45,7 @@ platforms: # ipv4_address: "10.11.1.2" - name: instance - image: "bodsch/ansible-${DISTRIBUTION:-debian:11}" + image: "bodsch/ansible-${DISTRIBUTION:-debian:12}" command: ${MOLECULE_DOCKER_COMMAND:-""} docker_host: "${DOCKER_HOST:-unix://run/docker.sock}" privileged: true diff --git a/roles/icingaweb2_themes/molecule/default/prepare.yml b/roles/icingaweb2_themes/molecule/default/prepare.yml index 18d0a99..9f86ef4 100644 --- a/roles/icingaweb2_themes/molecule/default/prepare.yml +++ b/roles/icingaweb2_themes/molecule/default/prepare.yml @@ -13,6 +13,9 @@ - name: update pacman system ansible.builtin.command: | pacman --refresh --sync --sysupgrade --noconfirm + register: pacman + changed_when: pacman.rc != 0 + failed_when: pacman.rc != 0 - name: create depends service ansible.builtin.copy: @@ -24,6 +27,14 @@ when: - ansible_os_family | lower == 'artix linux' + - name: make sure python3-apt is installed (only debian based) + ansible.builtin.package: + name: + - python3-apt + state: present + when: + - ansible_os_family | lower == 'debian' + - name: update package cache become: true ansible.builtin.package: @@ -51,7 +62,6 @@ gather_facts: true roles: - - role: apparmor - role: snapd - role: mariadb diff --git a/roles/icingaweb2_themes/molecule/default/requirements.yml b/roles/icingaweb2_themes/molecule/default/requirements.yml index 93e08b0..b16b54f 100644 --- a/roles/icingaweb2_themes/molecule/default/requirements.yml +++ b/roles/icingaweb2_themes/molecule/default/requirements.yml @@ -2,34 +2,22 @@ - name: snapd src: https://github.com/bodsch/ansible-snapd - version: 1.2.2 - -- name: apparmor - src: https://github.com/bodsch/ansible-apparmor - version: 2.0.0 + version: 1.3.1 - name: php-fpm src: https://github.com/bodsch/ansible-php - version: 2.2.0 + version: 2.3.0 - name: nginx src: https://github.com/bodsch/ansible-nginx - version: 0.25.0 - -- name: monitoring-tools - src: https://github.com/bodsch/ansible-monitoring-plugins - version: 1.4.2 + version: 0.27.1 - name: mariadb src: https://github.com/bodsch/ansible-mariadb - version: 2.4.1 + version: 2.5.0 -# - name: icinga2 -# src: bodsch.icinga2 -# version: 1.9.0 -# -# - name: icingaweb -# src: bodsch.icingaweb2 -# version: 1.10.2 +- name: monitoring-tools + src: https://github.com/bodsch/ansible-monitoring-plugins + version: 1.5.0 ...