mirror of
https://github.com/aljazceru/ansible-role-mysql.git
synced 2025-12-18 23:14:21 +01:00
Fix Ansible 2.x deprecation warnings.
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
force: "{{ item.force | default(False) }}"
|
force: "{{ item.force | default(False) }}"
|
||||||
with_items: mysql_config_include_files
|
with_items: "{{ mysql_config_include_files }}"
|
||||||
notify: restart mysql
|
notify: restart mysql
|
||||||
|
|
||||||
- name: Create slow query log file (if configured).
|
- name: Create slow query log file (if configured).
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
collation: "{{ item.collation | default('utf8_general_ci') }}"
|
collation: "{{ item.collation | default('utf8_general_ci') }}"
|
||||||
encoding: "{{ item.encoding | default('utf8') }}"
|
encoding: "{{ item.encoding | default('utf8') }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: mysql_databases
|
with_items: "{{ mysql_databases }}"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
shell: >
|
shell: >
|
||||||
mysql -u root -NBe
|
mysql -u root -NBe
|
||||||
'SET PASSWORD FOR "{{ mysql_root_username }}"@"{{ item }}" = PASSWORD("{{ mysql_root_password }}");'
|
'SET PASSWORD FOR "{{ mysql_root_username }}"@"{{ item }}" = PASSWORD("{{ mysql_root_password }}");'
|
||||||
with_items: mysql_root_hosts.stdout_lines
|
with_items: "{{ mysql_root_hosts.stdout_lines }}"
|
||||||
when: mysql_install_packages | bool or mysql_root_password_update
|
when: mysql_install_packages | bool or mysql_root_password_update
|
||||||
|
|
||||||
# Has to be after the root password assignment, for idempotency.
|
# Has to be after the root password assignment, for idempotency.
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
name: ""
|
name: ""
|
||||||
host: "{{ item }}"
|
host: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items: mysql_anonymous_hosts.stdout_lines
|
with_items: "{{ mysql_anonymous_hosts.stdout_lines }}"
|
||||||
|
|
||||||
- name: Remove MySQL test database.
|
- name: Remove MySQL test database.
|
||||||
mysql_db: "name='test' state=absent"
|
mysql_db: "name='test' state=absent"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
- name: Ensure MySQL packages are installed.
|
- name: Ensure MySQL packages are installed.
|
||||||
apt: "name={{ item }} state=installed"
|
apt: "name={{ item }} state=installed"
|
||||||
with_items: mysql_packages
|
with_items: "{{ mysql_packages }}"
|
||||||
register: deb_mysql_install_packages
|
register: deb_mysql_install_packages
|
||||||
|
|
||||||
# Because Ubuntu starts MySQL as part of the install process, we need to stop
|
# Because Ubuntu starts MySQL as part of the install process, we need to stop
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure MySQL packages are installed.
|
- name: Ensure MySQL packages are installed.
|
||||||
yum: "name={{ item }} state=installed enablerepo={{ mysql_enablerepo }}"
|
yum: "name={{ item }} state=installed enablerepo={{ mysql_enablerepo }}"
|
||||||
with_items: mysql_packages
|
with_items: "{{ mysql_packages }}"
|
||||||
register: rh_mysql_install_packages
|
register: rh_mysql_install_packages
|
||||||
|
|
||||||
- name: Ensure MySQL Python libraries are installed.
|
- name: Ensure MySQL Python libraries are installed.
|
||||||
|
|||||||
@@ -7,4 +7,4 @@
|
|||||||
priv: "{{ item.priv | default('*.*:USAGE') }}"
|
priv: "{{ item.priv | default('*.*:USAGE') }}"
|
||||||
state: present
|
state: present
|
||||||
append_privs: "{{ item.append_privs | default('no') }}"
|
append_privs: "{{ item.append_privs | default('no') }}"
|
||||||
with_items: mysql_users
|
with_items: "{{ mysql_users }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user