From ff294a32f963a08da589eab3da1d13473e761e72 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 19:35:45 +0200 Subject: [PATCH 01/14] Run on molecule 4.0.4 --- .github/workflows/ansible-integration-workflow.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index a7df48d..ef9de0e 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -14,8 +14,9 @@ on: description: "Default pip dependencies for molecule" type: string default: | - molecule[docker] - molecule-goss + ansible-core + molecule==4.0.4 + molecule-plugins[docker] jmespath role-dependencies: required: false From 92d70bcddda003e6e743ad04ffbf26ca70dcfde1 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 19:54:00 +0200 Subject: [PATCH 02/14] Remove empty commnd --- .github/workflows/ansible-integration-workflow.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index ef9de0e..57fd94a 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -34,7 +34,6 @@ on: platforms: - name: instance image: "geerlingguy/docker-\$\{MOLECULE_DISTRO:-debian11\}-ansible:latest" - command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true From ce016a86adc9f0c15113a02175dff730263b19b9 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 20:00:18 +0200 Subject: [PATCH 03/14] Run molecule 5.0.1 --- .github/workflows/ansible-integration-workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index 57fd94a..b2eb81d 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -15,7 +15,7 @@ on: type: string default: | ansible-core - molecule==4.0.4 + molecule==5.0.1 molecule-plugins[docker] jmespath role-dependencies: From 32a245aab52b9862f75bd63a755ce67b0b5f7fe3 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 20:13:44 +0200 Subject: [PATCH 04/14] Revert "Run on ubuntu 22.04" This reverts commit 9195803368d4073373503ca92a18a6a13c434a46. --- .github/workflows/ansible-integration-workflow.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index b2eb81d..bb0fa9e 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -51,7 +51,7 @@ on: jobs: lint: name: Lint - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -64,7 +64,7 @@ jobs: test: name: Molecule - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 strategy: matrix: distro: ${{ fromJSON(inputs.distros) }} From e6f21858179c4b169bd6bb319a229bed2a046041 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 20:35:05 +0200 Subject: [PATCH 05/14] Install correct requirements file --- .github/workflows/ansible-integration-workflow.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index bb0fa9e..c827ae2 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -105,11 +105,8 @@ jobs: cache: "pip" cache-dependency-path: "molecule/requirements.txt" - - name: Install Dependencies - run: pip3 install -r molecule/requirements.txt - - name: Install Ansible Role Requirements - run: ansible-galaxy install -r molecule/requirements.yml + run: ansible-galaxy install -r requirements.yml if: inputs.role-dependencies != '' - name: Disable AppArmor (MySQL) From 48258302892c6729a7a34c1e05e263900220cb92 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 20:39:09 +0200 Subject: [PATCH 06/14] Install molecule! --- .github/workflows/ansible-integration-workflow.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index c827ae2..7db3405 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -105,6 +105,9 @@ jobs: cache: "pip" cache-dependency-path: "molecule/requirements.txt" + - name: Install testing dependencies + run: pip3 install -r molecule/requirements.txt + - name: Install Ansible Role Requirements run: ansible-galaxy install -r requirements.yml if: inputs.role-dependencies != '' From 7a16cb6170a0777858c576f0ed6034e88c2a7938 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 21:36:14 +0200 Subject: [PATCH 07/14] Revert "Revert "Run on ubuntu 22.04"" This reverts commit 32a245aab52b9862f75bd63a755ce67b0b5f7fe3. --- .github/workflows/ansible-integration-workflow.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index 7db3405..26a1ef0 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -51,7 +51,7 @@ on: jobs: lint: name: Lint - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -64,7 +64,7 @@ jobs: test: name: Molecule - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: distro: ${{ fromJSON(inputs.distros) }} From d8fc556581ca9e919d134bdefdfedfe8977cf6b9 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 21:36:40 +0200 Subject: [PATCH 08/14] Ansible and yq are already installed --- .github/workflows/ansible-integration-workflow.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index 26a1ef0..ccae3eb 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -14,7 +14,6 @@ on: description: "Default pip dependencies for molecule" type: string default: | - ansible-core molecule==5.0.1 molecule-plugins[docker] jmespath @@ -73,9 +72,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup yq - uses: mikefarah/yq@v4.33.1 - - name: Prepare Molecule Tests run: | # Creating required directories From 13092bcb48585880794dd113073530cecae49316 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 21:50:58 +0200 Subject: [PATCH 09/14] We need empty command otherwise systemd is not PID1 --- .github/workflows/ansible-integration-workflow.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index ccae3eb..0679c82 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -33,6 +33,7 @@ on: platforms: - name: instance image: "geerlingguy/docker-\$\{MOLECULE_DISTRO:-debian11\}-ansible:latest" + command: "" volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true From 5a638fb845ae8058470dce88e51e4c3d2485b496 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 22:13:27 +0200 Subject: [PATCH 10/14] Don't verify in github molecule-goss is archived --- .github/workflows/ansible-integration-workflow.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index 0679c82..ca873a3 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -35,7 +35,9 @@ on: image: "geerlingguy/docker-\$\{MOLECULE_DISTRO:-debian11\}-ansible:latest" command: "" volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - /var/lib/containerd + cgroupns_mode: host privileged: true pre_build_image: true provisioner: @@ -90,10 +92,10 @@ jobs: fi # Add verify playbook if exists - if test -f "molecule/default/verify.yml"; then - yq e --inplace '.provisioner.playbooks += {"verify":"../default/verify.yml"}' molecule/github/molecule.yml - yq e --inplace '. += {"verifier": {"name": "goss", "directory": "../default/tests/"}}' molecule/github/molecule.yml - fi + # if test -f "molecule/default/verify.yml"; then + # yq e --inplace '.provisioner.playbooks += {"verify":"../default/verify.yml"}' molecule/github/molecule.yml + # yq e --inplace '. += {"verifier": {"name": "goss", "directory": "../default/tests/"}}' molecule/github/molecule.yml + # fi - name: Setup Python uses: actions/setup-python@v4 From c24f5d8ec372b1ab48ce6b12687d22db0590b5eb Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 22:17:37 +0200 Subject: [PATCH 11/14] Delete var role-dependencies requirements.yml is needed anyway --- .github/workflows/ansible-integration-workflow.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index ca873a3..5e5bf10 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -17,11 +17,6 @@ on: molecule==5.0.1 molecule-plugins[docker] jmespath - role-dependencies: - required: false - description: "Default role dependencies for ansible (empty)" - type: string - default: "" molecule-config: required: false description: "Configuration for molecule" @@ -83,8 +78,6 @@ jobs: echo "${{ inputs.python-dependencies }}" > molecule/requirements.txt # Writing molecule config for docker echo "${{ inputs.molecule-config}}" > molecule/github/molecule.yml - # Writing ansible role requirements - echo "${{ inputs.role-dependencies }}" > molecule/requirements.yml # Add prepare playbook if exists if test -f "molecule/default/prepare.yml"; then @@ -109,7 +102,6 @@ jobs: - name: Install Ansible Role Requirements run: ansible-galaxy install -r requirements.yml - if: inputs.role-dependencies != '' - name: Disable AppArmor (MySQL) run: | @@ -131,7 +123,7 @@ jobs: echo "Print molecule/default/converge.yml" cat molecule/default/converge.yml if [ -f "molecule/default/prepare.yml" ]; then echo "Print molecule/default/prepare.yml" && cat molecule/default/prepare.yml; fi - if [ -f "molecule/default/verify.yml" ]; then echo "Print molecule/default/verify.yml" && cat molecule/default/verify.yml; fi + #if [ -f "molecule/default/verify.yml" ]; then echo "Print molecule/default/verify.yml" && cat molecule/default/verify.yml; fi - name: Molecule Test run: molecule test -s github From 905aa2101af0057f6e03c5f96e5e568cd0c90b91 Mon Sep 17 00:00:00 2001 From: t2d Date: Sun, 7 May 2023 22:36:18 +0200 Subject: [PATCH 12/14] Continue if requirements.yml is not present --- .github/workflows/ansible-integration-workflow.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index 5e5bf10..b063c5a 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -102,6 +102,7 @@ jobs: - name: Install Ansible Role Requirements run: ansible-galaxy install -r requirements.yml + continue-on-error: true - name: Disable AppArmor (MySQL) run: | From c398e9e33b614ac7a60a89e014451573be7c8e76 Mon Sep 17 00:00:00 2001 From: t2d Date: Tue, 9 May 2023 16:00:21 +0200 Subject: [PATCH 13/14] Don't copy verify playbooks Our roles use molecule-goss which is discontinued --- .github/workflows/ansible-integration-workflow.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ansible-integration-workflow.yaml b/.github/workflows/ansible-integration-workflow.yaml index b063c5a..f85882a 100644 --- a/.github/workflows/ansible-integration-workflow.yaml +++ b/.github/workflows/ansible-integration-workflow.yaml @@ -84,12 +84,6 @@ jobs: yq e --inplace '.provisioner.playbooks += {"prepare":"../default/prepare.yml"}' molecule/github/molecule.yml fi - # Add verify playbook if exists - # if test -f "molecule/default/verify.yml"; then - # yq e --inplace '.provisioner.playbooks += {"verify":"../default/verify.yml"}' molecule/github/molecule.yml - # yq e --inplace '. += {"verifier": {"name": "goss", "directory": "../default/tests/"}}' molecule/github/molecule.yml - # fi - - name: Setup Python uses: actions/setup-python@v4 with: @@ -124,7 +118,6 @@ jobs: echo "Print molecule/default/converge.yml" cat molecule/default/converge.yml if [ -f "molecule/default/prepare.yml" ]; then echo "Print molecule/default/prepare.yml" && cat molecule/default/prepare.yml; fi - #if [ -f "molecule/default/verify.yml" ]; then echo "Print molecule/default/verify.yml" && cat molecule/default/verify.yml; fi - name: Molecule Test run: molecule test -s github From d982d185336c00051162cb1db773e05d3d2ccc63 Mon Sep 17 00:00:00 2001 From: 0x46616c6b <0x46616c6b@users.noreply.github.com> Date: Tue, 9 May 2023 17:12:23 +0200 Subject: [PATCH 14/14] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1088281..59c183e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ |---|---|---|---| | distros | string | '[ "debian11", "debian10" ]' | List of distributions to test against the Role | | python-dependencies | string | [see workflow](.github/workflows/ansible-integration-workflow.yaml) | Default pip dependencies for molecule | -| role-dependencies | string | [see workflow](.github/workflows/ansible-integration-workflow.yaml) | Default role dependencies for ansible (empty)| | molecule-config | string | [see workflow](.github/workflows/ansible-integration-workflow.yaml) | Configuration for molecule | | disable-apparmor-mysql | boolean | false | Disable AppArmor MySQL Profile for the Job Runner |