From 18e8b7bcd3c0394dbc397083f20ce607ac767709 Mon Sep 17 00:00:00 2001 From: Tobias Bauriedel Date: Fri, 16 Aug 2024 17:28:28 +0200 Subject: [PATCH] add molecule test for go-carbon --- .../{molecule_carbonapi.yml => molecule.yml} | 4 ++-- README.md | 1 + molecule/go-carbon/converge.yml | 9 +++++++++ molecule/go-carbon/molecule.yml | 18 ++++++++++++++++++ molecule/go-carbon/verify.yml | 8 ++++++++ roles/go-carbon/tasks/setup.yml | 1 + 6 files changed, 39 insertions(+), 2 deletions(-) rename .github/workflows/{molecule_carbonapi.yml => molecule.yml} (93%) create mode 100644 molecule/go-carbon/converge.yml create mode 100644 molecule/go-carbon/molecule.yml create mode 100644 molecule/go-carbon/verify.yml diff --git a/.github/workflows/molecule_carbonapi.yml b/.github/workflows/molecule.yml similarity index 93% rename from .github/workflows/molecule_carbonapi.yml rename to .github/workflows/molecule.yml index 4957703..a068763 100644 --- a/.github/workflows/molecule_carbonapi.yml +++ b/.github/workflows/molecule.yml @@ -1,5 +1,5 @@ --- -name: Test role carbonapi +name: Ansible deployment on: pull_request: @@ -17,7 +17,7 @@ jobs: strategy: matrix: distro: ['rockylinux8', 'ubuntu2204', 'debian12'] - scenario: ['carbonapi'] + scenario: ['carbonapi', 'go-carbon'] steps: - name: Checkout code diff --git a/README.md b/README.md index 01a2632..de4325b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ![Lint](https://github.com/tbauriedel/ansible-collection-gographite/actions/workflows/linting.yml/badge.svg) +![Molecule](https://github.com/tbauriedel/ansible-collection-gographite/actions/workflows/molecule.yml/badge.svg) # ansible-role-gographite diff --git a/molecule/go-carbon/converge.yml b/molecule/go-carbon/converge.yml new file mode 100644 index 0000000..fbc12ab --- /dev/null +++ b/molecule/go-carbon/converge.yml @@ -0,0 +1,9 @@ +--- +- name: Converge + hosts: all + + collections: + - tbauriedel.gographite + + roles: + - go-carbon diff --git a/molecule/go-carbon/molecule.yml b/molecule/go-carbon/molecule.yml new file mode 100644 index 0000000..97fd603 --- /dev/null +++ b/molecule/go-carbon/molecule.yml @@ -0,0 +1,18 @@ +--- +dependency: + name: galaxy +driver: + name: docker +platforms: + - name: go-carbon + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" + command: ${MOLECULE_DOCKER_COMMAND:-""} + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + pre_build_image: true +provisioner: + name: ansible +verifier: + name: ansible diff --git a/molecule/go-carbon/verify.yml b/molecule/go-carbon/verify.yml new file mode 100644 index 0000000..69971ca --- /dev/null +++ b/molecule/go-carbon/verify.yml @@ -0,0 +1,8 @@ +--- +- name: Verify + hosts: all + tasks: + - name: Ensure service is running + ansible.builtin.service: + name: go-carbon + state: started diff --git a/roles/go-carbon/tasks/setup.yml b/roles/go-carbon/tasks/setup.yml index c198df2..68589ba 100644 --- a/roles/go-carbon/tasks/setup.yml +++ b/roles/go-carbon/tasks/setup.yml @@ -18,6 +18,7 @@ ansible.builtin.dnf: name: "{{ _fetched_source.dest }}" state: present + disable_gpg_check: true when: ansible_os_family == 'RedHat' - name: Ensure storage-dir exists