From bb73839cc42531c2acaf7c7a8841276d36caeb18 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 01:36:54 +0300 Subject: [PATCH 01/10] init attempt Signed-off-by: Tasos Katsoulas --- .github/workflows/molecule-test.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/molecule-test.yml diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml new file mode 100644 index 0000000..e971d41 --- /dev/null +++ b/.github/workflows/molecule-test.yml @@ -0,0 +1,34 @@ +name: Molecule-test + +on: + push: + branches: + - master + pull_request: null +jobs: + molecule: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + scenario: + - centos7 + - Debian10 + - debian11 + - fedora35 + - oraclelinux8 + - rockylinux8 + - ubuntu18.04 + - ubuntu2004 + - ubuntu2204 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: "${{ github.repository }}" + - name: Molecule + uses: gofrolist/molecule-action@v2 + with: + molecule_command: test + env: + ANSIBLE_FORCE_COLOR: '1' \ No newline at end of file From dff4ecd9034a66d84f5451525ecd1a01d6f41e99 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 01:51:38 +0300 Subject: [PATCH 02/10] add args Signed-off-by: Tasos Katsoulas --- .github/workflows/molecule-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml index e971d41..ad7a9fb 100644 --- a/.github/workflows/molecule-test.yml +++ b/.github/workflows/molecule-test.yml @@ -30,5 +30,6 @@ jobs: uses: gofrolist/molecule-action@v2 with: molecule_command: test + molecule_args: --scenario-name ${{ matrix.scenario }} env: ANSIBLE_FORCE_COLOR: '1' \ No newline at end of file From 63f2eba248f07bf1689b5a4c6dbccaaf89d6923d Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 01:53:09 +0300 Subject: [PATCH 03/10] test Signed-off-by: Tasos Katsoulas --- 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 1aaaca2..4ff79a5 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -55,7 +55,7 @@ platforms: provisioner: name: ansible env: - MOLECULE_NO_LOG: false +# MOLECULE_NO_LOG: false verifier: name: ansible From 2cab5fce0f8a48059b8a5d0f7fe47a7205781999 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 02:04:51 +0300 Subject: [PATCH 04/10] test Signed-off-by: Tasos Katsoulas --- molecule/default/molecule.yml | 5 +++-- requirements.yml | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 requirements.yml diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 4ff79a5..9a244f0 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -1,7 +1,8 @@ --- dependency: name: galaxy - + options: + role-file: requirements.yml driver: name: docker @@ -55,7 +56,7 @@ platforms: provisioner: name: ansible env: -# MOLECULE_NO_LOG: false + MOLECULE_NO_LOG: false verifier: name: ansible diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..3f4f2ea --- /dev/null +++ b/requirements.yml @@ -0,0 +1,5 @@ +--- +collections: + - name: community.docker + version: "*" # Need to ensure that the latest version is installed or Molecule fails +roles: [] \ No newline at end of file From 47b497792f20f9631167135c3aae4682bd5846aa Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 02:11:14 +0300 Subject: [PATCH 05/10] add dependencies step Signed-off-by: Tasos Katsoulas --- .github/workflows/molecule-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml index ad7a9fb..49cc658 100644 --- a/.github/workflows/molecule-test.yml +++ b/.github/workflows/molecule-test.yml @@ -26,6 +26,10 @@ jobs: uses: actions/checkout@v4 with: path: "${{ github.repository }}" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install "${{ matrix.ansible-version }}" ansible-lint molecule molecule-plugins[docker] docker flake8 flake8-bugbear flake8-docstrings flake8-import-order flake8-pylint pytest pytest-testinfra yamllint - name: Molecule uses: gofrolist/molecule-action@v2 with: From b1a3c1def30900037b5ceb19dbc69abe9d4975c9 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 02:12:40 +0300 Subject: [PATCH 06/10] minor oversight Signed-off-by: Tasos Katsoulas --- .github/workflows/molecule-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml index 49cc658..5bd928d 100644 --- a/.github/workflows/molecule-test.yml +++ b/.github/workflows/molecule-test.yml @@ -29,7 +29,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install "${{ matrix.ansible-version }}" ansible-lint molecule molecule-plugins[docker] docker flake8 flake8-bugbear flake8-docstrings flake8-import-order flake8-pylint pytest pytest-testinfra yamllint + python -m pip install ansible-lint molecule molecule-plugins[docker] docker flake8 flake8-bugbear flake8-docstrings flake8-import-order flake8-pylint pytest pytest-testinfra yamllint - name: Molecule uses: gofrolist/molecule-action@v2 with: From 490ee4c2cbcdd3b2986bb293f2b394d6c5e2d71c Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 02:16:21 +0300 Subject: [PATCH 07/10] go Signed-off-by: Tasos Katsoulas --- .github/workflows/molecule-test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml index 5bd928d..f76ae05 100644 --- a/.github/workflows/molecule-test.yml +++ b/.github/workflows/molecule-test.yml @@ -26,10 +26,14 @@ jobs: uses: actions/checkout@v4 with: path: "${{ github.repository }}" + - name: Init python env + uses: actions/setup-python@v4 + with: + python-version: "3.9" - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install ansible-lint molecule molecule-plugins[docker] docker flake8 flake8-bugbear flake8-docstrings flake8-import-order flake8-pylint pytest pytest-testinfra yamllint + pip install --upgrade pip + pip install ansible-lint molecule molecule-plugins[docker] docker flake8 flake8-bugbear flake8-docstrings flake8-import-order flake8-pylint pytest pytest-testinfra yamllint - name: Molecule uses: gofrolist/molecule-action@v2 with: From a0abf3d451f617524480ba8c56269673df490bba Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 02:18:46 +0300 Subject: [PATCH 08/10] different approach Signed-off-by: Tasos Katsoulas --- .github/workflows/molecule-test.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml index f76ae05..8e4b68e 100644 --- a/.github/workflows/molecule-test.yml +++ b/.github/workflows/molecule-test.yml @@ -12,15 +12,15 @@ jobs: fail-fast: false matrix: scenario: - - centos7 - - Debian10 - - debian11 - - fedora35 - - oraclelinux8 - - rockylinux8 - - ubuntu18.04 - - ubuntu2004 - - ubuntu2204 +# - centos7 +# - Debian10 +# - debian11 +# - fedora35 +# - oraclelinux8 +# - rockylinux8 +# - ubuntu18.04 +# - ubuntu2004 + - ubuntu2204 steps: - name: Checkout uses: actions/checkout@v4 @@ -38,6 +38,5 @@ jobs: uses: gofrolist/molecule-action@v2 with: molecule_command: test - molecule_args: --scenario-name ${{ matrix.scenario }} env: ANSIBLE_FORCE_COLOR: '1' \ No newline at end of file From f0015670503af9e5673d0485a219c33b0888d2a3 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 02:34:29 +0300 Subject: [PATCH 09/10] d approacj Signed-off-by: Tasos Katsoulas --- .github/workflows/molecule-test.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml index 8e4b68e..381f1c5 100644 --- a/.github/workflows/molecule-test.yml +++ b/.github/workflows/molecule-test.yml @@ -12,15 +12,15 @@ jobs: fail-fast: false matrix: scenario: -# - centos7 -# - Debian10 -# - debian11 -# - fedora35 -# - oraclelinux8 -# - rockylinux8 -# - ubuntu18.04 -# - ubuntu2004 - - ubuntu2204 + - centos7 + - Debian10 + - debian11 + - fedora35 + - oraclelinux8 + - rockylinux8 + - ubuntu18.04 + - ubuntu2004 + - ubuntu2204 steps: - name: Checkout uses: actions/checkout@v4 @@ -34,9 +34,6 @@ jobs: run: | pip install --upgrade pip pip install ansible-lint molecule molecule-plugins[docker] docker flake8 flake8-bugbear flake8-docstrings flake8-import-order flake8-pylint pytest pytest-testinfra yamllint - - name: Molecule - uses: gofrolist/molecule-action@v2 - with: - molecule_command: test - env: - ANSIBLE_FORCE_COLOR: '1' \ No newline at end of file + - name: Run molecule tests + run: | + molecule test --scenario-name ${{ matrix.scenario }} --platform-name ${{ matrix.scenario }} \ No newline at end of file From 3c8d4bdacd2a1eaf3a9f78b7a74ca3d91eb61cd7 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Fri, 15 Sep 2023 04:17:21 +0300 Subject: [PATCH 10/10] rebase and also remove the pre_build_image flag Signed-off-by: Tasos Katsoulas --- molecule/default/molecule.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 9a244f0..1d459eb 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -14,12 +14,12 @@ platforms: - name: Debian10 image: debian:10 - pre_build_image: false + pre_build_image: true dockerfile: ../common/Dockerfile_debian10.j2 - name: debian11 image: debian:11 - pre_build_image: false + pre_build_image: true dockerfile: ../common/Dockerfile_debian11.j2 - name: fedora35