Skip to content

Commit

Permalink
update molecule for mysql_exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
bodsch committed Jul 13, 2024
1 parent 049c1b0 commit 862323e
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 43 deletions.
16 changes: 3 additions & 13 deletions roles/mysql_exporter/molecule/configured/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,17 @@ dependency:
driver:
name: docker

lint: |
set -e
yamllint .
ansible-lint .
flake8 .
platforms:
- name: instance
image: "bodsch/ansible-${DISTRIBUTION:-debian:11}"
image: "bodsch/ansible-${DISTRIBUTION:-debian:12}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
docker_host: "${DOCKER_HOST:-unix://run/docker.sock}"
privileged: true
pre_build_image: true
cgroupns_mode: host
mounts:
- source: /sys/fs/cgroup
target: /sys/fs/cgroup
type: bind
read_only: false
volumes:
- /var/lib/containerd
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /var/lib/containerd
capabilities:
- SYS_ADMIN
tmpfs:
Expand Down
17 changes: 17 additions & 0 deletions roles/mysql_exporter/molecule/configured/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- name: update pacman system
ansible.builtin.command: |
pacman --refresh --sync --sysupgrade --noconfirm
register: pacman
changed_when: pacman.rc != 0
failed_when: pacman.rc != 0

- name: create depends service
ansible.builtin.copy:
Expand All @@ -24,11 +27,25 @@
when:
- ansible_os_family | lower == 'artix linux'

- name: make sure python3-apt is installed (only debian based)
ansible.builtin.package:
name:
- python3-apt
state: present
when:
- ansible_os_family | lower == 'debian'

- name: update package cache
become: true
ansible.builtin.package:
update_cache: true

- name: install dependencies
ansible.builtin.package:
name:
- iproute2
state: present

- name: environment
ansible.builtin.debug:
msg:
Expand Down
2 changes: 1 addition & 1 deletion roles/mysql_exporter/molecule/configured/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

- name: mariadb
src: bodsch.mariadb
version: 2.4.1
version: 2.4.3

...
16 changes: 3 additions & 13 deletions roles/mysql_exporter/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,17 @@ dependency:
driver:
name: docker

lint: |
set -e
yamllint .
ansible-lint .
flake8 .
platforms:
- name: instance
image: "bodsch/ansible-${DISTRIBUTION:-debian:11}"
image: "bodsch/ansible-${DISTRIBUTION:-debian:12}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
docker_host: "${DOCKER_HOST:-unix://run/docker.sock}"
privileged: true
pre_build_image: true
cgroupns_mode: host
mounts:
- source: /sys/fs/cgroup
target: /sys/fs/cgroup
type: bind
read_only: false
volumes:
- /var/lib/containerd
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /var/lib/containerd
capabilities:
- SYS_ADMIN
tmpfs:
Expand Down
17 changes: 17 additions & 0 deletions roles/mysql_exporter/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- name: update pacman system
ansible.builtin.command: |
pacman --refresh --sync --sysupgrade --noconfirm
register: pacman
changed_when: pacman.rc != 0
failed_when: pacman.rc != 0

- name: create depends service
ansible.builtin.copy:
Expand All @@ -24,11 +27,25 @@
when:
- ansible_os_family | lower == 'artix linux'

- name: make sure python3-apt is installed (only debian based)
ansible.builtin.package:
name:
- python3-apt
state: present
when:
- ansible_os_family | lower == 'debian'

- name: update package cache
become: true
ansible.builtin.package:
update_cache: true

- name: install dependencies
ansible.builtin.package:
name:
- iproute2
state: present

- name: environment
ansible.builtin.debug:
msg:
Expand Down
2 changes: 1 addition & 1 deletion roles/mysql_exporter/molecule/default/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

- name: mariadb
src: bodsch.mariadb
version: 2.4.1
version: 2.4.3

...
16 changes: 3 additions & 13 deletions roles/mysql_exporter/molecule/latest/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,17 @@ dependency:
driver:
name: docker

lint: |
set -e
yamllint .
ansible-lint .
flake8 .
platforms:
- name: instance
image: "bodsch/ansible-${DISTRIBUTION:-debian:11}"
image: "bodsch/ansible-${DISTRIBUTION:-debian:12}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
docker_host: "${DOCKER_HOST:-unix://run/docker.sock}"
privileged: true
pre_build_image: true
cgroupns_mode: host
mounts:
- source: /sys/fs/cgroup
target: /sys/fs/cgroup
type: bind
read_only: false
volumes:
- /var/lib/containerd
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /var/lib/containerd
capabilities:
- SYS_ADMIN
tmpfs:
Expand Down
17 changes: 17 additions & 0 deletions roles/mysql_exporter/molecule/latest/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- name: update pacman system
ansible.builtin.command: |
pacman --refresh --sync --sysupgrade --noconfirm
register: pacman
changed_when: pacman.rc != 0
failed_when: pacman.rc != 0

- name: create depends service
ansible.builtin.copy:
Expand All @@ -24,11 +27,25 @@
when:
- ansible_os_family | lower == 'artix linux'

- name: make sure python3-apt is installed (only debian based)
ansible.builtin.package:
name:
- python3-apt
state: present
when:
- ansible_os_family | lower == 'debian'

- name: update package cache
become: true
ansible.builtin.package:
update_cache: true

- name: install dependencies
ansible.builtin.package:
name:
- iproute2
state: present

- name: environment
ansible.builtin.debug:
msg:
Expand Down
2 changes: 1 addition & 1 deletion roles/mysql_exporter/molecule/latest/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

- name: mariadb
src: bodsch.mariadb
version: 2.4.1
version: 2.4.3

...
1 change: 0 additions & 1 deletion roles/mysql_exporter/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ flake8
molecule
molecule-plugins[docker]
netaddr
pytest>=7.4.0,<8.0.0
pytest-testinfra
tox
tox-gh-actions
Expand Down
1 change: 1 addition & 0 deletions roles/mysql_exporter/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ deps =
ansible_8.5: ansible>=8.5,<8.6
ansible_9.0: ansible>=9.0,<9.1
ansible_9.5: ansible>=9.5,<9.6
ansible_10.0: ansible>=10.0,<10.1

#commands_pre =
# /usr/bin/find {toxinidir} -type f -not -path '{toxworkdir}/*' -path '*/__pycache__/*' -name '*.py[c|o]' -delete
Expand Down

0 comments on commit 862323e

Please sign in to comment.