This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update pre-commit hooks * Update requirements * Set `tmpfs` for centos7 scenario * Set `VOLUME` in Dockerfile * Add pre-task for checking systemd status * Run workflow on `ubuntu-latest` * Check `firewall_default_zone` return code in `changed_when` * Try without `tmpfs` * Update action versions * Try setting `volumes` and `cgroupns_mode` * Add a prepare playbook * Add default scenario * Remove centos7 and rocky8 scenarios * Set docker image in gha workflow
- Loading branch information
1 parent
5579a79
commit f63f0c6
Showing
15 changed files
with
97 additions
and
118 deletions.
There are no files selected for viewing
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,4 +1,5 @@ | ||
ansible-lint==6.10.0 | ||
molecule==4.0.4 | ||
molecule-docker==2.1.0 | ||
yamllint==1.28.0 | ||
ansible-lint | ||
molecule | ||
molecule-plugins[docker] | ||
yamllint | ||
requests==2.29.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
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
FROM {{ item.image }} | ||
|
||
ENV container=docker | ||
|
||
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ | ||
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | ||
rm -f /lib/systemd/system/multi-user.target.wants/*;\ | ||
rm -f /etc/systemd/system/*.wants/*;\ | ||
rm -f /lib/systemd/system/local-fs.target.wants/*; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ | ||
rm -f /lib/systemd/system/basic.target.wants/*;\ | ||
rm -f /lib/systemd/system/anaconda.target.wants/*; | ||
|
||
RUN if [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 sudo bash iproute && dnf clean all; \ | ||
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y /usr/bin/python /usr/bin/python2-config sudo yum-plugin-ovl bash iproute initscripts && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; fi | ||
|
||
VOLUME ["/sys/fs/cgroup"] | ||
CMD ["/usr/sbin/init"] |
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,20 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
gather_facts: true | ||
pre_tasks: | ||
- name: Wait for systemd to complete initialization. # noqa command-instead-of-module | ||
ansible.builtin.command: systemctl is-system-running | ||
register: systemctl_status | ||
until: > | ||
'running' in systemctl_status.stdout or | ||
'degraded' in systemctl_status.stdout | ||
retries: 30 | ||
delay: 5 | ||
when: ansible_service_mgr == 'systemd' | ||
changed_when: false | ||
failed_when: systemctl_status.rc > 1 | ||
tasks: | ||
- name: "Include ansible-role-firewalld" | ||
ansible.builtin.include_role: | ||
name: "ansible-role-firewalld" |
32 changes: 20 additions & 12 deletions
32
molecule/rocky8/molecule.yml → molecule/default/molecule.yml
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,46 +1,54 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
|
||
driver: | ||
name: docker | ||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint | ||
|
||
platforms: | ||
- name: firewall_db | ||
image: rockylinux:8 | ||
image: ${MOLECULE_DOCKER_IMAGE:-centos:7} | ||
image_version: latest | ||
command: "" | ||
pre_build_image: false | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
pre_build_image: false | ||
privileged: true | ||
groups: | ||
- db | ||
- docker | ||
|
||
- name: firewall_web | ||
image: rockylinux:8 | ||
image: ${MOLECULE_DOCKER_IMAGE:-centos:7} | ||
image_version: latest | ||
command: "" | ||
pre_build_image: false | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
pre_build_image: false | ||
privileged: true | ||
groups: | ||
- docker | ||
- web | ||
|
||
provisioner: | ||
name: ansible | ||
lint: | ||
name: ansible-lint | ||
log: true | ||
playbooks: | ||
converge: ../resources/converge.yml | ||
inventory: | ||
links: | ||
group_vars: ../resources/inventory/group_vars/ | ||
playbooks: | ||
prepare: prepare.yml | ||
converge: converge.yml | ||
verify: verify.yml | ||
|
||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint | ||
verifier: | ||
name: ansible |
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,15 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
gather_facts: true | ||
tasks: | ||
- name: Install firewalld | ||
ansible.builtin.package: | ||
name: firewalld | ||
state: present | ||
|
||
- name: Change firewalld backend to iptables | ||
ansible.builtin.lineinfile: | ||
path: /etc/firewalld/firewalld.conf | ||
regexp: "^FirewallBackend=" | ||
line: FirewallBackend=iptables |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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