You've already forked percona
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdeb93f4dc | ||
|
|
e14f28f6c1 | ||
|
|
45334ef3c3 | ||
|
|
c2693caf0e |
@@ -4,7 +4,7 @@ Installs and manages Percona Server on Debian.
|
||||
|
||||
## Requirements
|
||||
|
||||
None.
|
||||
- Ansible 10+
|
||||
|
||||
## Role Variables
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ percona_table_definition_cache: 2000
|
||||
|
||||
# InnoDB settings
|
||||
percona_innodb_buffer_pool_size: "1G"
|
||||
percona_innodb_buffer_pool_instances: 1
|
||||
percona_innodb_log_file_size: "256M"
|
||||
percona_innodb_log_buffer_size: "16M"
|
||||
percona_innodb_flush_log_at_trx_commit: 1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: percona | configure Percona Server
|
||||
template:
|
||||
src: my.cnf.j2
|
||||
dest: /etc/mysql/conf.d/01-ansible.cnf
|
||||
dest: /etc/mysql/conf.d/01-override.cnf
|
||||
mode: '0644'
|
||||
notify: Restart Percona Server
|
||||
|
||||
@@ -28,4 +28,4 @@
|
||||
plugin_auth_string: "{{ percona_root_password }}"
|
||||
salt: "{{ percona_caching_sha2_password_salt }}"
|
||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||
ignore_errors: true # In case password is already set and socket auth is disabled
|
||||
ignore_errors: true # In case password is already set and socket auth is disabled
|
||||
|
||||
@@ -3,25 +3,47 @@
|
||||
mysql_user:
|
||||
name: "{{ item.name }}"
|
||||
password: "{{ item.password }}"
|
||||
host: "{{ item.host | default('%') }}"
|
||||
priv: "{{ item.priv | default('*.*:USAGE') }}"
|
||||
host: "{{ item.host }}"
|
||||
priv: "{{ (item.priv | join('/')) if item.priv is iterable and item.priv is not string else (item.priv | default('*.*:USAGE')) }}"
|
||||
plugin: "mysql_native_password"
|
||||
state: present
|
||||
login_user: root
|
||||
login_password: "{{ percona_root_password }}"
|
||||
loop: "{{ percona_users }}"
|
||||
when: item.auth_plugin is defined and item.auth_plugin == 'mysql_native_password'
|
||||
vars:
|
||||
user_host_pairs: |
|
||||
{%- set pairs = [] -%}
|
||||
{%- for user in percona_users -%}
|
||||
{%- if user.auth_plugin is defined and user.auth_plugin == 'mysql_native_password' -%}
|
||||
{%- set hosts = [user.host | default('%')] if user.host is undefined or user.host is string else user.host -%}
|
||||
{%- for host in hosts -%}
|
||||
{%- set _ = pairs.append(user | combine({'host': host})) -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{{ pairs }}
|
||||
loop: "{{ user_host_pairs }}"
|
||||
|
||||
- name: percona | create users
|
||||
mysql_user:
|
||||
name: "{{ item.name }}"
|
||||
host: "{{ item.host | default('%') }}"
|
||||
priv: "{{ item.priv | default('*.*:USAGE') }}"
|
||||
host: "{{ item.host }}"
|
||||
priv: "{{ (item.priv | join('/')) if item.priv is iterable and item.priv is not string else (item.priv | default('*.*:USAGE')) }}"
|
||||
plugin: caching_sha2_password
|
||||
plugin_auth_string: "{{ item.password }}"
|
||||
salt: "{{ percona_caching_sha2_password_salt }}"
|
||||
state: present
|
||||
login_user: root
|
||||
login_password: "{{ percona_root_password }}"
|
||||
loop: "{{ percona_users }}"
|
||||
when: item.auth_plugin is not defined or item.auth_plugin == 'caching_sha2_password'
|
||||
vars:
|
||||
user_host_pairs: |
|
||||
{%- set pairs = [] -%}
|
||||
{%- for user in percona_users -%}
|
||||
{%- if user.auth_plugin is not defined or user.auth_plugin == 'caching_sha2_password' -%}
|
||||
{%- set hosts = [user.host | default('%')] if user.host is undefined or user.host is string else user.host -%}
|
||||
{%- for host in hosts -%}
|
||||
{%- set _ = pairs.append(user | combine({'host': host})) -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{{ pairs }}
|
||||
loop: "{{ user_host_pairs }}"
|
||||
|
||||
@@ -26,6 +26,7 @@ table_definition_cache = {{ percona_table_definition_cache }}
|
||||
|
||||
# InnoDB settings
|
||||
innodb_buffer_pool_size = {{ percona_innodb_buffer_pool_size }}
|
||||
innodb_buffer_pool_instances = {{ percona_innodb_buffer_pool_instances }}
|
||||
innodb_log_file_size = {{ percona_innodb_log_file_size }}
|
||||
innodb_log_buffer_size = {{ percona_innodb_log_buffer_size }}
|
||||
innodb_flush_log_at_trx_commit = {{ percona_innodb_flush_log_at_trx_commit }}
|
||||
@@ -65,4 +66,4 @@ performance_schema = {{ percona_performance_schema }}
|
||||
sql_mode = {{ percona_sql_mode }}
|
||||
|
||||
# Authentication
|
||||
mysql_native_password = ON
|
||||
mysql_native_password = ON
|
||||
|
||||
Reference in New Issue
Block a user