From 16c7e750f6f88c536ee63354f149bd4b870ca4ee Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Mon, 26 Aug 2024 15:23:59 +0200 Subject: [PATCH] :rocket: Upstream management on molecule --- defaults/main.yml | 3 +-- molecule/_shared/base.yml | 2 -- molecule/_shared/inventory/group_vars/all.yml | 1 + .../_shared/inventory/group_vars/upstream.yml | 4 ++++ .../converge.yml | 0 .../{_shared => debian12_master_slave}/verify.yml | 0 molecule/debian12_upstream/converge.yml | 9 +++++++++ molecule/debian12_upstream/molecule.yml | 15 +++++++++++++++ molecule/debian12_upstream/verify.yml | 11 +++++++++++ 9 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 molecule/_shared/inventory/group_vars/upstream.yml rename molecule/{_shared => debian12_master_slave}/converge.yml (100%) rename molecule/{_shared => debian12_master_slave}/verify.yml (100%) create mode 100644 molecule/debian12_upstream/converge.yml create mode 100644 molecule/debian12_upstream/molecule.yml create mode 100644 molecule/debian12_upstream/verify.yml diff --git a/defaults/main.yml b/defaults/main.yml index 35b17f7..7227d8b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -69,7 +69,6 @@ mariadb_extra_configuration: {} # ------------------------------------- mariadb_replication_master: false mariadb_replication_slave: false -# This formula don't work with vagrant! All boxes have same default ip! mariadb_server_id: "{{ ansible_default_ipv4.address | ipaddr('int') }}" mariadb_replication_user: 'repl' @@ -117,7 +116,7 @@ mariadb_users: [] # MariaDB Upstream # ------------------------------------- mariadb_upstream_setup_script: 'https://r.mariadb.com/downloads/mariadb_repo_setup' -mariadb_upstream_version: '10.6' +mariadb_upstream_version: '11.4' # ------------------------------------- # Galera diff --git a/molecule/_shared/base.yml b/molecule/_shared/base.yml index 61cc729..7c395d3 100644 --- a/molecule/_shared/base.yml +++ b/molecule/_shared/base.yml @@ -25,9 +25,7 @@ provisioner: connection: pipelining: true playbooks: - converge: ../_shared/converge.yml prepare: ../_shared/prepare.yml - verify: ../_shared/verify.yml inventory: group_vars: all: diff --git a/molecule/_shared/inventory/group_vars/all.yml b/molecule/_shared/inventory/group_vars/all.yml index d751075..35d6256 100644 --- a/molecule/_shared/inventory/group_vars/all.yml +++ b/molecule/_shared/inventory/group_vars/all.yml @@ -6,3 +6,4 @@ mariadb_extra_configuration: mariadb_install_xtrabackup_package: true mariadb_slow_query_log_enabled: true mariadb_debug_role: true +mariadb_innodb_buffer_pool_size: 128M diff --git a/molecule/_shared/inventory/group_vars/upstream.yml b/molecule/_shared/inventory/group_vars/upstream.yml new file mode 100644 index 0000000..6c78aa8 --- /dev/null +++ b/molecule/_shared/inventory/group_vars/upstream.yml @@ -0,0 +1,4 @@ +--- + +mariadb_version: '11.2' +mariadb_origin: 'upstream' diff --git a/molecule/_shared/converge.yml b/molecule/debian12_master_slave/converge.yml similarity index 100% rename from molecule/_shared/converge.yml rename to molecule/debian12_master_slave/converge.yml diff --git a/molecule/_shared/verify.yml b/molecule/debian12_master_slave/verify.yml similarity index 100% rename from molecule/_shared/verify.yml rename to molecule/debian12_master_slave/verify.yml diff --git a/molecule/debian12_upstream/converge.yml b/molecule/debian12_upstream/converge.yml new file mode 100644 index 0000000..1d52e7f --- /dev/null +++ b/molecule/debian12_upstream/converge.yml @@ -0,0 +1,9 @@ +--- + +- name: Converge + hosts: all + gather_facts: true + tasks: + - name: Include role + ansible.builtin.include_role: + name: "hanxhx.mysql" diff --git a/molecule/debian12_upstream/molecule.yml b/molecule/debian12_upstream/molecule.yml new file mode 100644 index 0000000..760a85c --- /dev/null +++ b/molecule/debian12_upstream/molecule.yml @@ -0,0 +1,15 @@ +--- + +platforms: + - name: debian12-upstream1 + image: dokken/debian-12 + command: /lib/systemd/systemd + dockerfile: ../_shared/Dockerfile.j2 + capabilities: + - SYS_ADMIN + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + privileged: true + groups: + - upstream diff --git a/molecule/debian12_upstream/verify.yml b/molecule/debian12_upstream/verify.yml new file mode 100644 index 0000000..ca418fc --- /dev/null +++ b/molecule/debian12_upstream/verify.yml @@ -0,0 +1,11 @@ +--- + +- name: Verify slave + hosts: all + gather_facts: false + tasks: + - name: COMMAND | Check if mariadb is running + ansible.builtin.command: "systemctl is-active mariadb" + register: mariadb_is_running + changed_when: false + failed_when: mariadb_is_running.rc != 0