2 # Copyright 2014, Rackspace US, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # cmframework.requires: initial_poweroff_hosts.yml, memcached-install.yml
17 - name: Galera container config
19 gather_facts: "{{ osa_gather_facts | default(True) }}"
22 - include: common-tasks/os-log-dir-setup.yml
25 - src: "/openstack/log/{{ inventory_hostname }}-mysql_logs"
26 dest: "/var/log/mysql_logs"
27 when: reinitialized_nodes is not defined or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
28 - include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
30 list_of_bind_mounts: "{{ galera_container_bind_mounts }}"
31 extra_container_config_no_restart:
32 - "lxc.start.order=10"
33 when: reinitialized_nodes is not defined or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
34 - include: common-tasks/unbound-clients.yml
37 - hostvars['localhost']['resolvconf_enabled'] | bool
38 - reinitialized_nodes is not defined or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
39 environment: "{{ deployment_environment_variables | default({}) }}"
43 - name: Install galera server
45 gather_facts: "{{ osa_gather_facts | default(True) }}"
48 - role: "galera_server"
49 when: reinitialized_nodes is not defined or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
50 - role: "rsyslog_client"
51 rsyslog_client_log_rotate_file: galera_log_rotate
52 rsyslog_client_log_dir: "/var/log/mysql_logs"
53 rsyslog_client_log_files:
56 rsyslog_client_config_name: "99-galera-rsyslog-client.conf"
59 when: reinitialized_nodes is not defined or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
60 - role: "system_crontab_coordination"
63 when: reinitialized_nodes is not defined or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
65 galera_server_id: "{{ inventory_hostname | string_2_int }}"
66 galera_wsrep_node_name: "{{ container_name }}"
67 environment: "{{ deployment_environment_variables | default({}) }}"
71 - name: Verify Galera cluster count.
72 hosts: baremetal-infra_hosts
75 given_cluster_count: "{{ groups['galera_all'] | count }}"
77 - name: Check the mysql cluster count
78 shell: mysql -e 'show status like "%wsrep_cluster_%";' | awk -F "wsrep_cluster_size" {'print $2'} |tr -d " \t\n\r"
79 register: cluster_count
80 until: cluster_count|success
81 failed_when: cluster_count.stdout != given_cluster_count