-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: mariadb_packages_install | installing mariadb-galera packages | ||
ansible.builtin.package: | ||
name: "{{ (galera_sst_method == 'mariabackup') | ternary( mariadb_packages | union( mariabackup_packages ), mariadb_packages ) }}" | ||
state: "{{ mariadb_upgrade | ternary( 'latest', 'present' ) }}" | ||
update_cache: true | ||
become: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[defaults] | ||
inventory = ./inventory |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
|
||
- name: Creating Galera Test Scenario | ||
hosts: localhost | ||
vars: | ||
openstack_cloud: testing | ||
openstack_ssh_key: testing | ||
openstack_flavor_name: gp1a.4 | ||
openstack_image_name_deb12: debian-12-generic-amd64 | ||
openstack_image_name_deb11: debian-11-generic-amd64 | ||
openstack_network_name: network-k0stesting_generic | ||
tasks: | ||
- name: Include variables | ||
ansible.builtin.include_vars: "vars/main.yml" | ||
|
||
- name: Fetch Image (Deb12) | ||
openstack.cloud.image_info: | ||
cloud: "{{ openstack_cloud }}" | ||
image: "{{ openstack_image_name_deb12 }}" | ||
register: _openstack_image_deb12 | ||
|
||
- name: Fetch Flavor | ||
openstack.cloud.compute_flavor_info: | ||
cloud: "{{ openstack_cloud }}" | ||
name: "{{ openstack_flavor_name }}" | ||
register: _openstack_flavor | ||
|
||
- name: Fetch Network | ||
openstack.cloud.networks_info: | ||
cloud: "{{ openstack_cloud }}" | ||
name: "{{ openstack_network_name }}" | ||
register: _openstack_network | ||
|
||
- name: Ensure SSH Key exists | ||
openstack.cloud.keypair: | ||
name: "{{ openstack_ssh_key }}" | ||
cloud: "{{ openstack_cloud }}" | ||
public_key_file: "{{ ansible_env.HOME }}/.ssh/testing.pub" | ||
|
||
- name: Create Galera Instances | ||
openstack.cloud.server: | ||
name: "{{ item }}" | ||
state: present | ||
image: "{{ _openstack_image_deb12.images[0].id }}" | ||
key_name: "{{ openstack_ssh_key }}" | ||
flavor: "{{ _openstack_flavor.flavors[0].id }}" | ||
network: "{{ _openstack_network.networks[0].id }}" | ||
terminate_volume: true | ||
security_groups: | ||
- 1aa4fd40-1650-4151-84a7-3f5ecc4c4b23 | ||
cloud: "{{ openstack_cloud }}" | ||
metadata: | ||
group: "{{ the_role_name }}" | ||
auto_ip: false | ||
loop: | ||
- galera-1 | ||
- galera-2 | ||
- galera-3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
|
||
- name: Destroying Test Scenario | ||
hosts: localhost | ||
vars: | ||
openstack_cloud: testing | ||
tasks: | ||
|
||
- name: Destroy Instances | ||
openstack.cloud.server: | ||
state: absent | ||
name: "{{ item }}" | ||
cloud: "{{ openstack_cloud }}" | ||
loop: | ||
- galera-1 | ||
- galera-2 | ||
- galera-3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
plugin: openstack.cloud.openstack | ||
expand_hostvars: true | ||
private: true | ||
legacy_groups: false | ||
keyed_groups: | ||
- key: openstack.metadata.group | ||
default_value: galera | ||
parent_group: all | ||
leading_separator: false | ||
only_clouds: | ||
- testing |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
|
||
- name: Creating Test Environment for Galera | ||
hosts: mariadb_galera_cluster | ||
order: sorted | ||
pre_tasks: | ||
- name: Set hostname | ||
ansible.builtin.hostname: | ||
name: "{{ inventory_hostname }}" | ||
become: true | ||
- name: Reload facts | ||
ansible.builtin.setup: | ||
- name: Refresh Inventory | ||
ansible.builtin.meta: refresh_inventory | ||
- name: Set Hostnames | ||
ansible.builtin.lineinfile: | ||
path: /etc/hosts | ||
line: "{{ hostvars[item].ansible_facts.default_ipv4.address }} {{ hostvars[item].ansible_facts.fqdn }}" | ||
become: true | ||
loop: "{{ ansible_play_hosts }}" | ||
- name: Set Hostnames IPv6 | ||
ansible.builtin.lineinfile: | ||
path: /etc/hosts | ||
line: "{{ hostvars[item].ansible_facts.default_ipv6.address }} {{ hostvars[item].ansible_facts.fqdn }}" | ||
become: true | ||
loop: "{{ ansible_play_hosts }}" | ||
- name: Include variables | ||
ansible.builtin.include_vars: "vars/main.yml" | ||
- name: Load mysqld_exporter vars | ||
ansible.builtin.include_vars: | ||
file: mysqld_exporter.yml | ||
roles: | ||
- role: adit.mariadb_galera_cluster | ||
Check failure on line 33 in tests/playbook.yml GitHub Actions / pre-commit Lintsyntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (debian10, 3.10)syntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (debian11, 3.10)syntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (debian12, 3.10)syntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (rocky8, 3.10)syntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (rocky9, 3.10)syntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (ubuntu1804, 3.10)syntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (ubuntu2004, 3.10)syntax-check[specific]
Check failure on line 33 in tests/playbook.yml GitHub Actions / Molecule Test (ubuntu2204, 3.10)syntax-check[specific]
|
||
tags: | ||
- mariadb_galera_cluster | ||
|
||
- name: MySQL Clustercheck | ||
hosts: mariadb_galera_cluster | ||
order: sorted | ||
pre_tasks: | ||
- name: Include variables | ||
ansible.builtin.include_vars: "vars/main.yml" | ||
- name: Load mysqld_exporter vars | ||
ansible.builtin.include_vars: | ||
file: mysqld_exporter.yml | ||
roles: | ||
- role: adit.mysql_clustercheck | ||
tags: | ||
- mysql_clustercheck | ||
|
||
- name: MySQL Clustercheck | ||
hosts: mariadb_galera_cluster | ||
order: sorted | ||
pre_tasks: | ||
- name: Include variables | ||
ansible.builtin.include_vars: "vars/main.yml" | ||
- name: Load mysqld_exporter vars | ||
ansible.builtin.include_vars: | ||
file: mysqld_exporter.yml | ||
roles: | ||
- role: prometheus.prometheus.mysqld_exporter | ||
tags: | ||
- prometheus_mysqld_exporter |