From 263f91ae0d4635feadc34db1e678332602c9d5ab Mon Sep 17 00:00:00 2001 From: Gabriel PREDA Date: Tue, 9 Jan 2024 15:15:25 +0200 Subject: [PATCH 1/2] * change ipwrap to ansible.utils.ipwrap --- requirements.yml | 2 ++ templates/etc/my.cnf.d/server.cnf.j2 | 2 +- templates/etc/my.cnf.d/server.cnf.temp.j2 | 2 +- templates/etc/mysql/conf.d/galera.cnf.j2 | 2 +- templates/etc/mysql/conf.d/galera.cnf.temp.j2 | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/requirements.yml b/requirements.yml index 3a35fcc..0278795 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,5 +1,7 @@ --- collections: + - name: ansible.utils + - name: ansible.netcommon - name: community.docker version: "*" # Need to ensure that the latest version is installed or Molecule fails roles: [] diff --git a/templates/etc/my.cnf.d/server.cnf.j2 b/templates/etc/my.cnf.d/server.cnf.j2 index abe4d9d..686ddde 100644 --- a/templates/etc/my.cnf.d/server.cnf.j2 +++ b/templates/etc/my.cnf.d/server.cnf.j2 @@ -52,7 +52,7 @@ wsrep_cluster_name="{{ galera_cluster_name }}" {% for node in galera_cluster_nodes %} {% set _ = _galera_cluster_node_addresses.append( hostvars[node]['galera_cluster_bind_address'] | default(hostvars[node]['ansible_' ~ galera_cluster_bind_interface]['ipv4']['address']) | mandatory ) %} {% endfor %} -wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ipwrap') | list | join(',') }}" +wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ansible.utils.ipwrap') | list | join(',') }}" # To start failed cluster comment out above and uncomment below...Once cluster is started revert changes and restart mysql on main node where change was made #wsrep_cluster_address="gcomm://" diff --git a/templates/etc/my.cnf.d/server.cnf.temp.j2 b/templates/etc/my.cnf.d/server.cnf.temp.j2 index 819b32d..ac02234 100644 --- a/templates/etc/my.cnf.d/server.cnf.temp.j2 +++ b/templates/etc/my.cnf.d/server.cnf.temp.j2 @@ -52,7 +52,7 @@ wsrep_cluster_name="{{ galera_cluster_name }}" {% for node in galera_cluster_nodes %} {% set _ = _galera_cluster_node_addresses.append( hostvars[node]['galera_cluster_bind_address'] | default(hostvars[node]['ansible_' ~ galera_cluster_bind_interface]['ipv4']['address']) | mandatory ) %} {% endfor %} -#wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ipwrap') | list | join(',') }}" +#wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ansible.utils.ipwrap') | list | join(',') }}" # To start failed cluster comment out above and uncomment below...Once cluster is started revert changes and restart mysql on main node where change was made wsrep_cluster_address="gcomm://" diff --git a/templates/etc/mysql/conf.d/galera.cnf.j2 b/templates/etc/mysql/conf.d/galera.cnf.j2 index abe4d9d..686ddde 100644 --- a/templates/etc/mysql/conf.d/galera.cnf.j2 +++ b/templates/etc/mysql/conf.d/galera.cnf.j2 @@ -52,7 +52,7 @@ wsrep_cluster_name="{{ galera_cluster_name }}" {% for node in galera_cluster_nodes %} {% set _ = _galera_cluster_node_addresses.append( hostvars[node]['galera_cluster_bind_address'] | default(hostvars[node]['ansible_' ~ galera_cluster_bind_interface]['ipv4']['address']) | mandatory ) %} {% endfor %} -wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ipwrap') | list | join(',') }}" +wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ansible.utils.ipwrap') | list | join(',') }}" # To start failed cluster comment out above and uncomment below...Once cluster is started revert changes and restart mysql on main node where change was made #wsrep_cluster_address="gcomm://" diff --git a/templates/etc/mysql/conf.d/galera.cnf.temp.j2 b/templates/etc/mysql/conf.d/galera.cnf.temp.j2 index d0a1fcc..879b41a 100644 --- a/templates/etc/mysql/conf.d/galera.cnf.temp.j2 +++ b/templates/etc/mysql/conf.d/galera.cnf.temp.j2 @@ -52,7 +52,7 @@ wsrep_cluster_name="{{ galera_cluster_name }}" {% for node in galera_cluster_nodes %} {% set _ = _galera_cluster_node_addresses.append( hostvars[node]['galera_cluster_bind_address'] | default(hostvars[node]['ansible_' ~ galera_cluster_bind_interface]['ipv4']['address']) | mandatory ) %} {% endfor %} -#wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ipwrap') | list | join(',') }}" +#wsrep_cluster_address="{{ 'gcomm://' ~ _galera_cluster_node_addresses | map('ansible.utils.ipwrap') | list | join(',') }}" # To start failed cluster comment out above and uncomment below...Once cluster is started revert changes and restart mysql on main node where change was made wsrep_cluster_address="gcomm://" From ffb244c2b92abc06374f71669d4049dd9d14bdb0 Mon Sep 17 00:00:00 2001 From: Gabriel PREDA Date: Tue, 9 Jan 2024 18:32:33 +0200 Subject: [PATCH 2/2] require at least ansible core 2.13.9 and collection ansible.util at least 2.12 --- requirements-dev.txt | 2 +- requirements.txt | 2 +- requirements.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e8941ea..26c155a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ ansible-compat==2.2.6 ; python_full_version >= "3.8.1" and python_version < "4.0" -ansible-core==2.13.7 ; python_version < "4.0" and python_full_version >= "3.8.1" +ansible-core==2.13.9 ; python_version < "4.0" and python_full_version >= "3.8.1" ansible-lint==6.8.7 ; python_full_version >= "3.8.1" and python_version < "4.0" ansible==6.6.0 ; python_full_version >= "3.8.1" and python_version < "4.0" arrow==1.2.3 ; python_full_version >= "3.8.1" and python_version < "4.0" diff --git a/requirements.txt b/requirements.txt index 7d21b27..cd647e1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ansible-core==2.13.7 ; python_full_version >= "3.8.1" and python_version < "4.0" +ansible-core==2.13.9 ; python_full_version >= "3.8.1" and python_version < "4.0" ansible==6.6.0 ; python_full_version >= "3.8.1" and python_version < "4.0" cffi==1.15.1 ; python_full_version >= "3.8.1" and python_version < "4.0" cryptography==38.0.4 ; python_full_version >= "3.8.1" and python_version < "4.0" diff --git a/requirements.yml b/requirements.yml index 0278795..3f6b224 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,6 +1,7 @@ --- collections: - name: ansible.utils + version: ">=2.12.0" - name: ansible.netcommon - name: community.docker version: "*" # Need to ensure that the latest version is installed or Molecule fails