Skip to content

Commit

Permalink
Workflow updates (#171)
Browse files Browse the repository at this point in the history
* Bump cryptography from 39.0.1 to 41.0.0
* Disable debian9 && centos8 superseeded by rocky8, Centos Stream 8 is another distribution
* Bump pre-commit version to current
* [molecule] Add debian12 scenario
* Add debian-12 vars
* [ansible-lint] remove outdated tag
* [ansible-lint] Add .ansible-lint-ignore

To be fixed at a later point
* Add default mariadb version for debian-12

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
kwizart and dependabot[bot] authored Aug 26, 2023
1 parent 8b7b80b commit 610551c
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file contains ignores rule violations for ansible-lint
tasks/configure_root_access.yml ignore-errors
tasks/setup_cluster.yml no-changed-when
4 changes: 2 additions & 2 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
# - alpine313
# - alpine314
# - centos7
- centos8
# - centos8
# - debian8
- debian9
- debian10
- debian11
- debian12
# - fedora
# - fedora34
# - fedora35
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ repos:
args: [--branch, develop, --branch, master, --branch, main]
- id: trailing-whitespace
- repo: https://github.com/ansible-community/ansible-lint
rev: v6.9.0
rev: v6.17.2
hooks:
- id: ansible-lint
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.7.0
hooks:
- id: black
language_version: python3
Expand All @@ -27,6 +27,6 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/adrienverge/yamllint
rev: v1.28.0
rev: v1.32.0
hooks:
- id: yamllint
22 changes: 22 additions & 0 deletions molecule/debian12/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******

Requirements
============

* Docker Engine

Install
=======

Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.

.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site

.. code-block:: bash
$ pip install 'molecule[docker]'
39 changes: 39 additions & 0 deletions molecule/debian12/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
dependency:
name: galaxy
enabled: false
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: node1
image: mrlesmithjr/debian:12
privileged: true
command: /lib/systemd/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
groups:
- galera-cluster-nodes
- name: node2
image: mrlesmithjr/debian:12
privileged: true
command: /lib/systemd/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
groups:
- galera-cluster-nodes
provisioner:
name: ansible
playbooks:
converge: ../shared/converge.yml
prepare: ../shared/prepare.yml
side_effect: ../shared/side_effect.yml
verifier:
name: ansible
9 changes: 9 additions & 0 deletions molecule/debian12/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true
8 changes: 4 additions & 4 deletions tasks/galera_monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
register: galera_monitoring_updated

- name: galera_monitoring | restarting mysql on first node
service: # noqa 503
service:
name: "{{ mariadb_systemd_service_name }}"
state: "restarted"
become: true
Expand All @@ -19,7 +19,7 @@
galera_monitoring_updated.changed
- name: galera_monitoring | waiting for mysql to start on first node
service: # noqa 503
service:
name: "{{ mariadb_systemd_service_name }}"
state: "started"
become: true
Expand All @@ -34,7 +34,7 @@
galera_monitoring_updated.changed
- name: galera_monitoring | restarting mysql on additional servers
service: # noqa 503
service:
name: "{{ mariadb_systemd_service_name }}"
state: "restarted"
become: true
Expand All @@ -44,7 +44,7 @@
galera_monitoring_updated.changed
- name: galera_monitoring | waiting for mysql to start on other nodes
service: # noqa 503
service:
name: "{{ mariadb_systemd_service_name }}"
state: "started"
become: true
Expand Down
6 changes: 3 additions & 3 deletions tasks/manage_node_state.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: manage_node_state | make node systemd service {{ mariadb_systemd_service_state }}
service: # noqa 503
service:
name: "{{ mariadb_systemd_service_name }}"
state: "{{ mariadb_systemd_service_state }}"
become: true
Expand All @@ -16,7 +16,7 @@
- inventory_hostname == item

- name: manage_node_state | ensure node is fully stopped before continuing
service: # noqa 503
service:
name: "{{ mariadb_systemd_service_name }}"
state: "stopped"
become: true
Expand All @@ -29,7 +29,7 @@
- inventory_hostname == item

- name: manage_node_state | ensure node is fully started before continuing
service: # noqa 503
service:
name: "{{ mariadb_systemd_service_name }}"
state: "started"
become: true
Expand Down
6 changes: 3 additions & 3 deletions tasks/mysql_databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
register: _db

- name: mysql_databases | copy database init scripts
copy: # noqa 503
copy:
src: "{{ item.item.init_script }}"
dest: "/tmp/{{ item.item.init_script | basename }}"
mode: "0600"
Expand All @@ -22,7 +22,7 @@
- item.item.init_script is defined

- name: mysql_databases | initialise databases
mysql_db: # noqa 503
mysql_db:
name: "{{ item.item.name }}"
state: import
target: "/tmp/{{ item.item.init_script | basename }}"
Expand All @@ -34,7 +34,7 @@
- item.item.init_script is defined

- name: mysql_databases | delete init scripts from the server
file: # noqa 503
file:
name: "/tmp/{{ item.item.init_script | basename }}"
state: absent
with_items: "{{ _db.results }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- galera_enable_mariadb_repo | bool

- name: redhat | clean dnf metadata (centos8 & fedora)
shell: "dnf clean all && rm -r /var/cache/dnf" # noqa 503
shell: "dnf clean all && rm -r /var/cache/dnf"
changed_when: false
become: true
when:
Expand Down
23 changes: 23 additions & 0 deletions vars/debian-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
mariadb_version: "10.11"
mariadb_login_unix_socket: "/var/run/mysqld/mysqld.sock"
mariadb_pre_req_packages:
- "apt-transport-https"
- "software-properties-common"
- "python3-pymysql"
- "rsync"
- "gnupg"
mariadb_debian_repo_key: "0xF1656F24C74CD1D8"
mariadb_packages:
- "mariadb-server"
mariabackup_packages:
- "mariadb-backup"
mariadb_certificates_dir: "/etc/mysql/certificates"
mariadb_systemd_service_name: "mariadb"
mariadb_confs:
- "etc/mysql/debian.cnf"
- "etc/mysql/my.cnf"
- "etc/mysql/conf.d/galera.cnf"
mariadb_temp_confs:
- "etc/mysql/conf.d/galera.cnf"
galera_wsrep_provider: "/usr/lib/galera/libgalera_smm.so"

0 comments on commit 610551c

Please sign in to comment.