%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /etc/ansible/roles/web/tasks/
Upload File :
Create Path :
Current File : //etc/ansible/roles/web/tasks/mysql-setup.yml

---
# configure mysql service
- name: remove mysql bind-address
  lineinfile:
    dest: /etc/my.cnf
    regexp: '^\s*bind-address\s*='
    state: absent
  delegate_to: "{{ master_server }}"
  tags: mysql

- name: restart mysqld
  service: name=mysqld  state=restarted
  delegate_to: "{{ master_server }}"
  tags: mysql

# create mysql users
- name: grant access to cluster user
  mysql_user: name={{ cluster_login }} password={{ cluster_password }} host={{ item }}
    priv='*.*:SUPER,SELECT,LOCK TABLES,CREATE TEMPORARY TABLES,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX,REPLICATION CLIENT,RELOAD' state=present
    login_unix_socket={{ mysql_socket }}
    append_privs=yes check_implicit_admin=yes update_password=always
  with_items:
    - localhost
    - '%'
  delegate_to: "{{ master_server }}"
  tags: mysql

- name: grant access to replica user
  mysql_user: name={{ replica_login }} password={{ replica_password }} host={{ item }}
    priv='*.*:SUPER,REPLICATION SLAVE,REPLICATION CLIENT' state=present
    login_unix_socket={{ mysql_socket }}
    append_privs=yes check_implicit_admin=yes update_password=always
  with_items:
    - localhost
    - '%'
  delegate_to: "{{ master_server }}"
  tags: mysql



Zerion Mini Shell 1.0