-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for icingaweb2 role with defaults
- Loading branch information
1 parent
0bba33d
commit 5c976ce
Showing
11 changed files
with
151 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
name: Empty role-icingaweb2 | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- main | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
paths: | ||
- roles/icingaweb2/** | ||
- molecule/role-icingaweb2/** | ||
pull_request: | ||
branches: | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
|
||
jobs: | ||
icingaweb2-ansible-latest: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
COLLECTION_NAMESPACE: icinga | ||
COLLECTION_NAME: icinga | ||
|
||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 | ||
matrix: | ||
distro: [ubuntu2204] | ||
python: ['3.10'] | ||
ansible: ['2.16.2'] | ||
scenario: [role-icingaweb2] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install dependencies ansible | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements-test-${{ matrix.ansible }}.txt | ||
- name: Install collection | ||
run: | | ||
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE | ||
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME | ||
- name: Test with molecule | ||
run: | | ||
ansible --version | ||
molecule --version | ||
molecule test -s ${{ matrix.scenario }} | ||
env: | ||
MOLECULE_DISTRO: ${{ matrix.distro }} |
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,5 @@ | ||
collections: | ||
- name: community.mysql | ||
- name: community.docker | ||
- name: community.general | ||
version: ">=2,<3" |
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,12 @@ | ||
--- | ||
|
||
- name: Converge | ||
hosts: all | ||
collections: | ||
- icinga.icinga | ||
pre_tasks: | ||
- ansible.builtin.include_role: | ||
name: repos | ||
post_tasks: | ||
- ansible.builtin.include_role: | ||
name: icingaweb2 |
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,4 @@ | ||
dependency: | ||
name: galaxy | ||
options: | ||
role-file: requirements.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### Business Process Config File ### | ||
# | ||
# Title : test | ||
# Description : test | ||
# Owner : icinga | ||
# AddToMenu : yes | ||
# Statetype : soft | ||
# | ||
################################### | ||
|
||
test2 = | ||
display 1;test2;test2 | ||
webserver = | ||
display 1;webserver;webserver |
Empty file.
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,26 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: icinga-default | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
link: | ||
host_vars: host_vars/ | ||
verifier: | ||
name: testinfra | ||
directory: tests/integration/ | ||
lint: | | ||
set -e | ||
yamllint --no-warnings roles/ | ||
ansible-lint roles/ |
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,11 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
tasks: | ||
- name: Install requirements for Debian | ||
apt: | ||
name: | ||
- gpg | ||
- apt-transport-https | ||
update_cache: yes | ||
when: ansible_os_family == "Debian" |
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 @@ | ||
roles: | ||
- geerlingguy.mysql |
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,9 @@ | ||
--- | ||
|
||
- name: Verify | ||
hosts: all | ||
tasks: | ||
- name: Check for running icinga2 | ||
service: | ||
name: icinga2 | ||
state: started |
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,5 @@ | ||
ansible-core==2.16.2 | ||
ansible-lint | ||
molecule | ||
molecule-docker | ||
pytest-testinfra |