From ec24d861177ecc5b64429338f698ba9e6ef8dcfc Mon Sep 17 00:00:00 2001 From: Hans Spaans Date: Fri, 29 Dec 2023 00:35:37 +0100 Subject: [PATCH 1/2] Update devcontainer and molecule configurations --- .devcontainer/devcontainer.json | 9 ++- .github/workflows/ci.yml | 2 - .gitignore | 3 +- molecule/debian/molecule.yml | 62 -------------------- molecule/default/molecule.yml | 101 ++++++++++++++++++++++++++++++++ molecule/ubuntu/molecule.yml | 42 ------------- 6 files changed, 111 insertions(+), 108 deletions(-) delete mode 100644 molecule/debian/molecule.yml create mode 100644 molecule/default/molecule.yml delete mode 100644 molecule/ubuntu/molecule.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0b8f9dd..3f3f7a7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,10 +1,17 @@ { "name": "Python 3", - "image": "mcr.microsoft.com/devcontainers/python:0-3.9", + "image": "mcr.microsoft.com/devcontainers/python:3.10", "features": { "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers-contrib/features/ansible:2": {}, "ghcr.io/devcontainers-contrib/features/flake8:2": {}, "ghcr.io/devcontainers-contrib/features/yamllint:2": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "redhat.ansible" + ] + } } } \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87cd947..0abccf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,6 @@ on: push: branches: - master - schedule: - - cron: '30 5 24 * *' jobs: ansible-role-ci: diff --git a/.gitignore b/.gitignore index d8de824..b03fea3 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,6 @@ ## Python .pytest_cache/ __pycache__/ -*.py[cod] +*.py[codz] *$py.class +pytestdebug.log \ No newline at end of file diff --git a/molecule/debian/molecule.yml b/molecule/debian/molecule.yml deleted file mode 100644 index 433e00d..0000000 --- a/molecule/debian/molecule.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker -lint: | - set -e - # stop the build if yamllint fails - yamllint `git ls-files '*.yaml' '*.yml'` - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics -platforms: - - name: debian-10 - image: "ghcr.io/hspaans/molecule-container-debian:10" - command: "" - cgroupns_mode: host - tmpfs: - - /run - - /tmp - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - privileged: true - pre_build_image: true - - name: debian-11 - image: "ghcr.io/hspaans/molecule-container-debian:11" - command: "" - cgroupns_mode: host - tmpfs: - - /run - - /tmp - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - privileged: true - pre_build_image: true - - name: debian-12 - image: "ghcr.io/hspaans/molecule-container-debian:12" - command: "" - cgroupns_mode: host - tmpfs: - - /run - - /tmp - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - privileged: true - pre_build_image: true -provisioner: - name: ansible - config_options: - defaults: - remote_tmp: /tmp - playbooks: - converge: ../resources/playbooks/converge.yml - prepare: ../resources/playbooks/prepare.yml - inventory: - group_vars: - all: - nrpe_plugin_packages: [] -verifier: - name: testinfra - directory: ../resources/tests/ diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml new file mode 100644 index 0000000..a589c9d --- /dev/null +++ b/molecule/default/molecule.yml @@ -0,0 +1,101 @@ +--- +dependency: + name: galaxy +driver: + name: docker +lint: | + set -e + # stop the build if yamllint fails + yamllint `git ls-files '*.yaml' '*.yml'` + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics +platforms: + - name: debian-10 + image: "ghcr.io/hspaans/molecule-containers:debian-10" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + + - name: debian-11 + image: "ghcr.io/hspaans/molecule-containers:debian-11" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + + - name: debian-12 + image: "ghcr.io/hspaans/molecule-containers:debian-12" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + + - name: fedora-38 + image: "ghcr.io/hspaans/molecule-containers:fedora-38" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + + - name: fedora-39 + image: "ghcr.io/hspaans/molecule-containers:fedora-39" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + + - name: ubuntu-20.04 + image: "ghcr.io/hspaans/molecule-containers:ubuntu-20.04" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + + - name: ubuntu-22.04 + image: "ghcr.io/hspaans/molecule-containers:ubuntu-22.04" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + + - name: ubuntu-24.04 + image: "ghcr.io/hspaans/molecule-containers:ubuntu-24.04" + command: "" + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true + +provisioner: + name: ansible + config_options: + defaults: + remote_tmp: /tmp + playbooks: + converge: ../resources/playbooks/converge.yml + prepare: ../resources/playbooks/prepare.yml + inventory: + group_vars: + all: + nrpe_plugin_packages: [] +verifier: + name: testinfra + directory: ../resources/tests/ diff --git a/molecule/ubuntu/molecule.yml b/molecule/ubuntu/molecule.yml deleted file mode 100644 index d891255..0000000 --- a/molecule/ubuntu/molecule.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker -lint: | - set -e - # stop the build if yamllint fails - yamllint `git ls-files '*.yaml' '*.yml'` - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics -platforms: - - name: ubuntu-20.04 - image: "ghcr.io/hspaans/molecule-container-ubuntu:20.04" - command: "" - cgroupns_mode: host - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - privileged: true - pre_build_image: true - - name: ubuntu-22.04 - image: "ghcr.io/hspaans/molecule-container-ubuntu:22.04" - command: "" - cgroupns_mode: host - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - privileged: true - pre_build_image: true -provisioner: - name: ansible - playbooks: - converge: ../resources/playbooks/converge.yml - prepare: ../resources/playbooks/prepare.yml - inventory: - group_vars: - all: - nrpe_plugin_packages: [] -verifier: - name: testinfra - directory: ../resources/tests/ From 1e4b51689174672d2ae4445ab6f9843f267bc069 Mon Sep 17 00:00:00 2001 From: Hans Spaans Date: Fri, 29 Dec 2023 00:42:00 +0100 Subject: [PATCH 2/2] Remove Fedora 38 and Fedora 39 platforms from molecule.yml --- molecule/default/molecule.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index a589c9d..3e321c3 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -39,24 +39,6 @@ platforms: privileged: true pre_build_image: true - - name: fedora-38 - image: "ghcr.io/hspaans/molecule-containers:fedora-38" - command: "" - cgroupns_mode: host - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - privileged: true - pre_build_image: true - - - name: fedora-39 - image: "ghcr.io/hspaans/molecule-containers:fedora-39" - command: "" - cgroupns_mode: host - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - privileged: true - pre_build_image: true - - name: ubuntu-20.04 image: "ghcr.io/hspaans/molecule-containers:ubuntu-20.04" command: ""