From fe65d04ed448f21e98a42a2c45ad23c683ecd31a Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Thu, 30 May 2024 15:02:34 -0700 Subject: [PATCH 1/8] fix: updates for modern ansible --- meta/main.yml | 9 +++++++-- tasks/main.yml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 739bb68..2238ed0 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -3,12 +3,17 @@ galaxy_info: description: Support logging to a specific file when using the syslog module on a Drupal site company: Acro Media Inc. license: GPLv3 - min_ansible_version: 2.5 + min_ansible_version: 2.6 platforms: - name: Ubuntu versions: - - 16.04 + - xenial + - bionic + - focal + - jammy + - noble - name: EL + versions: - 6 galaxy_tags: [] dependencies: [] diff --git a/tasks/main.yml b/tasks/main.yml index 0fcb90c..d70e0f1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: "Set some os-specific facts" - include: "{{ ansible_os_family }}.yml" + include_tasks: "{{ ansible_os_family }}.yml" tags: - always From 8440904f828521f622135dfe697d7c4df5881881 Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Fri, 31 May 2024 11:18:51 -0700 Subject: [PATCH 2/8] fix: tests --- molecule/default/molecule.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 7d4ff10..eecdcda 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -1,20 +1,22 @@ --- +role_name_check: 1 dependency: name: galaxy driver: name: docker platforms: - name: instance - image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu1804-ansible:latest'} + image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu2004-ansible:latest'} command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true pre_build_image: true + tmpfs: + - /tmp + - /run provisioner: name: ansible - playbooks: - converge: ${MOLECULE_PLAYBOOK:-converge.yml} config_options: defaults: verbosity: ${MOLECULE_VERBOSITY:-0} From 269104e7470f82a5fa416a2d7f19fee7dab2b19f Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Fri, 31 May 2024 11:57:56 -0700 Subject: [PATCH 3/8] fix: test stuff --- .github/workflows/molecule.yml | 26 +++++++++++++------------- handlers/main.yml | 4 ++++ molecule/default/molecule.yml | 9 ++++++--- molecule/default/prepare.yml | 6 ++++++ requirements.yml | 3 +++ 5 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 molecule/default/prepare.yml create mode 100644 requirements.yml diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 642c88b..7b60a90 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -8,12 +8,15 @@ on: pull_request: branches: - master + schedule: + - cron: '5 4 */14 * *' # Twice / month, at 4:05 AM. + jobs: lint: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: "${{ github.repository }}" - name: molecule @@ -26,21 +29,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - image: - - geerlingguy/docker-ubuntu2004-ansible:latest - - geerlingguy/docker-ubuntu1804-ansible:latest - - geerlingguy/docker-ubuntu1604-ansible:latest - - geerlingguy/docker-centos8-ansible:latest - - geerlingguy/docker-centos7-ansible:latest + config: + - image: "ubuntu" + tag: "latest" # latest == noble, as of this writing. + - image: "ubuntu" + tag: "jammy" steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: "${{ github.repository }}" - name: molecule - uses: robertdebock/molecule-action@2.6.3 + uses: robertdebock/molecule-action@6.0.1 with: - image: "${{ matrix.image }}" - options: parallel - env: - MOLECULE_DOCKER_IMAGE: "${{ matrix.image }}" + image: ${{ matrix.config.image }} + tag: ${{ matrix.config.tag }} diff --git a/handlers/main.yml b/handlers/main.yml index 7a78414..3c022f7 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -3,3 +3,7 @@ service: name: rsyslog state: restarted + +- name: ards systemctl daemon-reexec + ansible.builtin.systemd: + daemon_reexec: true diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index eecdcda..8591954 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -2,12 +2,15 @@ role_name_check: 1 dependency: name: galaxy + options: + role-file: requirements.yml + requirements-file: requirements.yml driver: name: docker platforms: - - name: instance - image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu2004-ansible:latest'} - command: ${MOLECULE_DOCKER_COMMAND:-""} + - name: "drupal-syslog-${image:-ubuntu}-${tag:-latest}${TOX_ENVNAME}" + image: "${namespace:-robertdebock}/${image:-ubuntu}:${tag:-latest}" + command: /sbin/init volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml new file mode 100644 index 0000000..050c21b --- /dev/null +++ b/molecule/default/prepare.yml @@ -0,0 +1,6 @@ +- name: Bootstrap + hosts: all + become: true + gather_facts: false + roles: + - role: robertdebock.bootstrap diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..11e3224 --- /dev/null +++ b/requirements.yml @@ -0,0 +1,3 @@ +--- +roles: + - name: robertdebock.bootstrap From b14668d3c3dbc8f5b40bfbb5d23da1be4546dc75 Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Fri, 31 May 2024 12:11:20 -0700 Subject: [PATCH 4/8] fix: remote tmp --- molecule/default/molecule.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 8591954..c5a1b5c 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -15,11 +15,9 @@ platforms: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true pre_build_image: true - tmpfs: - - /tmp - - /run provisioner: name: ansible config_options: defaults: verbosity: ${MOLECULE_VERBOSITY:-0} + remote_tmp: /tmp/.ansible-${USER} From 415dde91049efb60bedba6c94666e94fe66f7a1a Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Fri, 31 May 2024 12:23:02 -0700 Subject: [PATCH 5/8] fix: tmp --- molecule/default/molecule.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index c5a1b5c..14cdde1 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -15,9 +15,11 @@ platforms: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true pre_build_image: true + tmpfs: + - /tmp provisioner: name: ansible config_options: defaults: verbosity: ${MOLECULE_VERBOSITY:-0} - remote_tmp: /tmp/.ansible-${USER} + remote_tmp: /tmp/.ansible From 2deb56074fe692f9e51d43c1c82649e3131ae92d Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Fri, 31 May 2024 12:31:31 -0700 Subject: [PATCH 6/8] fix: root tmp --- molecule/default/molecule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 14cdde1..0fdb9f0 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -22,4 +22,4 @@ provisioner: config_options: defaults: verbosity: ${MOLECULE_VERBOSITY:-0} - remote_tmp: /tmp/.ansible + remote_tmp: /tmp From 075e7a51233a5512a7b9178d63416301d267bc71 Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Fri, 31 May 2024 12:52:00 -0700 Subject: [PATCH 7/8] fix: more tmpfs --- molecule/default/molecule.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 0fdb9f0..36b7c28 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -17,6 +17,8 @@ platforms: pre_build_image: true tmpfs: - /tmp + - /run + - /run/lock provisioner: name: ansible config_options: From d2bc3cab64fa7e0cbba1f2fdcac267560c738efd Mon Sep 17 00:00:00 2001 From: Jaden Seniuk Date: Mon, 3 Jun 2024 14:53:04 -0700 Subject: [PATCH 8/8] fix: rw and cgroupns host --- molecule/default/molecule.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 36b7c28..6a4c5fc 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -11,8 +11,9 @@ platforms: - name: "drupal-syslog-${image:-ubuntu}-${tag:-latest}${TOX_ENVNAME}" image: "${namespace:-robertdebock}/${image:-ubuntu}:${tag:-latest}" command: /sbin/init + cgroupns_mode: host volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw privileged: true pre_build_image: true tmpfs: