-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add molecule testing for Debian and Centos (#57)
Incorporate molecule framework testing to ensure the podman and setup roles successfully run against various platforms. As of this commit, the testing targets centos:stream8 and debian:11 Other changes: - use ansible/ansible-lint@main for the linting check, and the job is now part of CI workflow. - Various changes to the playbooks to make them idempotent, which is tested in molecule. - Bump meta runtime requires to >=2.13.0
- Loading branch information
1 parent
e0e5453
commit 2671ebb
Showing
18 changed files
with
159 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
|
||
name: CI | ||
|
||
'on': | ||
pull_request: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
molecule: | ||
name: molecule | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
pip install -r molecule/requirements.txt | ||
- name: Run Molecule | ||
env: | ||
MOLECULE_VERBOSITY: 3 | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
run: | | ||
molecule test | ||
ansible-lint: | ||
name: ansible-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Important: This sets up your GITHUB_WORKSPACE environment variable | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run ansible-lint | ||
uses: ansible/ansible-lint@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
requires_ansible: ">=2.11" | ||
requires_ansible: ">=2.13.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM debian:11 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
init \ | ||
python3 \ | ||
&& apt-get clean all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
- name: Create | ||
hosts: all | ||
gather_facts: true | ||
tasks: | ||
- name: Create the receptor user | ||
ansible.builtin.user: | ||
name: receptor | ||
shell: /bin/bash | ||
|
||
- name: Run podman role | ||
ansible.builtin.import_role: | ||
name: ansible.receptor.podman | ||
|
||
- name: Run setup role | ||
ansible.builtin.import_role: | ||
name: ansible.receptor.setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
dependency: | ||
name: galaxy | ||
options: | ||
requirements-file: requirements.yml | ||
driver: | ||
name: podman | ||
platforms: | ||
- name: molecule-centos | ||
image: quay.io/centos/centos:stream8 | ||
pre_build_image: true | ||
systemd: true | ||
privileged: true | ||
command: "/usr/sbin/init" | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
|
||
- name: molecule-debian | ||
image: debian:11 | ||
dockerfile: Containerfile.j2 | ||
pre_build_image: false | ||
systemd: true | ||
privileged: true | ||
command: "/lib/systemd/systemd" | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
|
||
provisioner: | ||
name: ansible | ||
inventory: | ||
host_vars: | ||
molecule-centos: | ||
podman_user: receptor | ||
podman_group: receptor | ||
ansible_connection: containers.podman.podman | ||
molecule-debian: | ||
ansible_connection: containers.podman.podman | ||
podman_user: receptor | ||
podman_group: receptor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
collections: | ||
- containers.podman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
molecule | ||
ansible-core | ||
molecule-plugins[podman] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
collections: | ||
- containers.podman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
- include_tasks: worksign_local.yml | ||
- name: Work signing local | ||
ansible.builtin.include_tasks: worksign_local.yml | ||
when: custom_worksign_private_keyfile is defined or custom_worksign_public_keyfile is defined |