openstack-ansible-galera_se.../tasks/galera_server_setup.yml
Dmitriy Rabotyagov 3add3ee734 Auto-fix yaml rules
In order to reduce divergance with ansible-lint rules, we apply
auto-fixing of violations.

In current patch we replace all kind of truthy variables with
`true` or `false` values to align with recommendations along with
alignment of used quotes.

Change-Id: I5f7e27158a4bf8f4bf14d4a5e32cc9204441da02
2025-02-12 08:21:19 +01:00

50 lines
1.7 KiB
YAML

---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Run mysql_upgrade
block:
- name: Fail if upgrade is needed
command: /usr/bin/mariadb-upgrade --check-if-upgrade-is-needed
register: galera_upgrade_check
failed_when: galera_upgrade_check.rc == 0
changed_when: false
rescue:
- name: Run MySQL Upgrade
command: /usr/bin/mariadb-upgrade
register: galera_mysql_upgrade
changed_when:
- not galera_mysql_upgrade.stdout is search("already upgraded")
until: galera_mysql_upgrade is success
retries: 3
delay: 10
# NOTE(noonedeadpunk): We don't need to verify hostname when connectig to socket
- name: Create galera users
community.mysql.mysql_user:
name: "{{ item.name }}"
host: "{{ item.host }}"
password: "{{ item.password }}"
priv: "{{ item.priv }}"
state: "{{ item.state }}"
resource_limits: "{{ item.resource_limits | default(omit) }}"
login_unix_socket: "{{ galera_unix_socket }}"
check_hostname: false
with_items: "{{ galera_setup_users }}"
register: galera_users
until: galera_users is success
retries: 3
delay: 10
no_log: true