56 lines
1.5 KiB
YAML
56 lines
1.5 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.
|
|
|
|
# Debian-sys-maint account is used to start/stop mysql. The password is auto
|
|
# generated but must be the same otherwise once data is synced, two nodes
|
|
# will not be able to start/stop mysql.
|
|
- name: Create mysql users
|
|
mysql_user:
|
|
name: "{{ item.name }}"
|
|
host: "{{ item.host }}"
|
|
password: "{{ item.password }}"
|
|
priv: "{{ item.priv }}"
|
|
state: "{{ item.state }}"
|
|
with_items:
|
|
- name: "root"
|
|
host: "%"
|
|
password: "{{ mysql_password }}"
|
|
priv: "*.*:ALL,GRANT"
|
|
state: present
|
|
|
|
- name: "root"
|
|
host: "localhost"
|
|
password: ""
|
|
priv: "*.*:ALL"
|
|
state: absent
|
|
|
|
- name: "debian-sys-maint"
|
|
host: 'localhost'
|
|
password: "{{ debian_sys_maint_password }}"
|
|
priv: "*.*:ALL"
|
|
state: present
|
|
|
|
- name: haproxy
|
|
host: '%'
|
|
password: ""
|
|
priv: "*.*:USAGE"
|
|
state: present
|
|
|
|
- name: haproxy
|
|
host: 'localhost'
|
|
password: ""
|
|
priv: "*.*:USAGE"
|
|
state: present
|