Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Lint yaml and Ansible configs
run: |
python -m pip install --upgrade pip
pip install ansible-lint==24.12.2 yamllint==1.35.1 ansible-core==2.16.3
pip install ansible-core==2.16.3 ansible-lint==24.12.2 yamllint==1.35.1
yamllint --config-file ./tests/yaml-lint.yml .
ansible-lint --config-file ./tests/ansible-lint.yml .
molecule:
Expand All @@ -37,12 +37,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install molecule-docker pytest-testinfra ansible
pip install molecule==25.9.0 molecule-docker==2.1.0 pytest-testinfra==10.2.2 ansible-core==2.16.3

- name: Start Docker
run: |
Expand Down
6 changes: 3 additions & 3 deletions tasks/common/custom-facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# --- Common ---

- name: Set fact for config file directories
set_fact:
ansible.builtin.set_fact:
_config_file_directories: >-
{{
_config_file_directories | default([]) +
Expand All @@ -18,7 +18,7 @@
label: "{{ item.key }}"

- name: Set fact for data_dirs hostPaths
set_fact:
ansible.builtin.set_fact:
_data_dirs_hostpaths: >-
{{
_data_dirs_hostpaths | default([]) +
Expand All @@ -34,7 +34,7 @@
loop: "{{ ports | dict2items }}"
when: item.value.ingressPort is defined

- name: Ensure ingress_list {{ _ingress_list }} contains valid port numbers
- name: Ensure ingress_list contains valid port numbers {{ _ingress_list }}
ansible.builtin.set_fact:
_ingress_list: "{{ _ingress_list | select('match', '^[0-9]+$') | list }}"

Expand Down
14 changes: 7 additions & 7 deletions tasks/common/download-binary.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Ensure destination directory [{{ destination_directory }}] exists
- name: Ensure destination directory exists {{ destination_directory }}
ansible.builtin.file:
path: "{{ destination_directory }}"
state: directory
Expand All @@ -11,15 +11,15 @@
binary_file_path: "/tmp/{{ binary_url | basename }}"
target_binary_path: "{{ destination_directory }}/{{ binary_file_name_override | default(binary_url | basename) }}"

- name: Download the binary file from [{{ binary_url }}] to [{{ binary_file_path }}]
- name: Download binary file {{ binary_url }}
ansible.builtin.get_url:
url: "{{ binary_url }}"
dest: "{{ binary_file_path }}"
mode: "0755"

- name: Handle binary file [{{ binary_file_name }}] based on type
- name: Handle binary file based on type {{ binary_file_name }}
block:
- name: Extract archive [{{ binary_file_name }}] to [{{ destination_directory }}]
- name: Extract archive {{ binary_file_name }}
ansible.builtin.unarchive:
src: "{{ binary_file_path }}"
dest: "{{ destination_directory }}"
Expand All @@ -28,21 +28,21 @@
- "--strip-components={{ binary_strip_components }}"
when: binary_file_name | regex_search('\.(tar|tar\.gz|tgz|zip)$')

- name: Move binary file [{{ binary_file_name }}] to [{{ target_binary_path }}]
- name: Move binary file {{ binary_file_name }}
ansible.builtin.command: >
mv {{ binary_file_path }} {{ target_binary_path }}
register: mv_output
changed_when: mv_output.rc != 0
when: not (binary_file_name | regex_search('\.(tar|tar\.gz|tgz|zip)$'))

- name: Check if the binary override file [{{ binary_file_name_override }}] exists at [{{ destination_directory }}]
- name: Check if binary override file exists {{ binary_file_name_override }}
ansible.builtin.stat:
path: "{{ destination_directory }}/{{ binary_file_name_override }}"
register: binary_override_file_stat
when:
- binary_file_name_override is defined

- name: Fail if override binary file [{{ binary_file_name_override }}] is missing at [{{ destination_directory }}]
- name: Fail if override binary file is missing {{ binary_file_name_override }}
ansible.builtin.fail:
msg: "The binary file does not exist at {{ destination_directory }}/{{ binary_file_name_override }}."
when:
Expand Down
2 changes: 1 addition & 1 deletion tasks/common/network-setup.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Allow service ingress ports {{ _ingress_list }} in iptables setup
- name: Allow service ingress ports in iptables setup {{ _ingress_list }}
ansible.builtin.iptables:
chain: INPUT
protocol: tcp
Expand Down
2 changes: 1 addition & 1 deletion tests/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ exclude_paths:
- ../.git/
- ../.github
- ../helm/
- ./*
- .ansible/
warn_list:
- experimental
12 changes: 12 additions & 0 deletions tests/molecule/container-basic/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ verifier:
directory: ./tests
scenario:
name: container-basic
test_sequence:
- dependency
- cleanup
- destroy
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
12 changes: 12 additions & 0 deletions tests/molecule/container-full/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,15 @@ verifier:
directory: ./tests
scenario:
name: container-full
test_sequence:
- dependency
- cleanup
- destroy
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
2 changes: 2 additions & 0 deletions tests/molecule/container-uninstall/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ scenario:
name: container-uninstall
test_sequence:
- dependency
- cleanup
- destroy
- create
- prepare
- converge
Expand Down
12 changes: 12 additions & 0 deletions tests/molecule/systemd-basic/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ verifier:
directory: ./tests
scenario:
name: systemd-basic
test_sequence:
- dependency
- cleanup
- destroy
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
12 changes: 12 additions & 0 deletions tests/molecule/systemd-full/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ verifier:
directory: ./tests
scenario:
name: systemd-full
test_sequence:
- dependency
- cleanup
- destroy
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
5 changes: 5 additions & 0 deletions tests/molecule/systemd-uninstall/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ scenario:
name: systemd-uninstall
test_sequence:
- dependency
- cleanup
- destroy
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
Loading