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
|
## Requirements
|
||||||
|
|
||||||
None.
|
- Ansible 10+
|
||||||
|
|
||||||
## Role Variables
|
## Role Variables
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ percona_table_definition_cache: 2000
|
|||||||
|
|
||||||
# InnoDB settings
|
# InnoDB settings
|
||||||
percona_innodb_buffer_pool_size: "1G"
|
percona_innodb_buffer_pool_size: "1G"
|
||||||
|
percona_innodb_buffer_pool_instances: 1
|
||||||
percona_innodb_log_file_size: "256M"
|
percona_innodb_log_file_size: "256M"
|
||||||
percona_innodb_log_buffer_size: "16M"
|
percona_innodb_log_buffer_size: "16M"
|
||||||
percona_innodb_flush_log_at_trx_commit: 1
|
percona_innodb_flush_log_at_trx_commit: 1
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
- name: percona | configure Percona Server
|
- name: percona | configure Percona Server
|
||||||
template:
|
template:
|
||||||
src: my.cnf.j2
|
src: my.cnf.j2
|
||||||
dest: /etc/mysql/conf.d/01-ansible.cnf
|
dest: /etc/mysql/conf.d/01-override.cnf
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
notify: Restart Percona Server
|
notify: Restart Percona Server
|
||||||
|
|
||||||
@@ -28,4 +28,4 @@
|
|||||||
plugin_auth_string: "{{ percona_root_password }}"
|
plugin_auth_string: "{{ percona_root_password }}"
|
||||||
salt: "{{ percona_caching_sha2_password_salt }}"
|
salt: "{{ percona_caching_sha2_password_salt }}"
|
||||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
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:
|
mysql_user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
password: "{{ item.password }}"
|
password: "{{ item.password }}"
|
||||||
host: "{{ item.host | default('%') }}"
|
host: "{{ item.host }}"
|
||||||
priv: "{{ item.priv | default('*.*:USAGE') }}"
|
priv: "{{ (item.priv | join('/')) if item.priv is iterable and item.priv is not string else (item.priv | default('*.*:USAGE')) }}"
|
||||||
plugin: "mysql_native_password"
|
plugin: "mysql_native_password"
|
||||||
state: present
|
state: present
|
||||||
login_user: root
|
login_user: root
|
||||||
login_password: "{{ percona_root_password }}"
|
login_password: "{{ percona_root_password }}"
|
||||||
loop: "{{ percona_users }}"
|
vars:
|
||||||
when: item.auth_plugin is defined and item.auth_plugin == 'mysql_native_password'
|
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
|
- name: percona | create users
|
||||||
mysql_user:
|
mysql_user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
host: "{{ item.host | default('%') }}"
|
host: "{{ item.host }}"
|
||||||
priv: "{{ item.priv | default('*.*:USAGE') }}"
|
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: caching_sha2_password
|
||||||
plugin_auth_string: "{{ item.password }}"
|
plugin_auth_string: "{{ item.password }}"
|
||||||
salt: "{{ percona_caching_sha2_password_salt }}"
|
salt: "{{ percona_caching_sha2_password_salt }}"
|
||||||
state: present
|
state: present
|
||||||
login_user: root
|
login_user: root
|
||||||
login_password: "{{ percona_root_password }}"
|
login_password: "{{ percona_root_password }}"
|
||||||
loop: "{{ percona_users }}"
|
vars:
|
||||||
when: item.auth_plugin is not defined or item.auth_plugin == 'caching_sha2_password'
|
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 settings
|
||||||
innodb_buffer_pool_size = {{ percona_innodb_buffer_pool_size }}
|
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_file_size = {{ percona_innodb_log_file_size }}
|
||||||
innodb_log_buffer_size = {{ percona_innodb_log_buffer_size }}
|
innodb_log_buffer_size = {{ percona_innodb_log_buffer_size }}
|
||||||
innodb_flush_log_at_trx_commit = {{ percona_innodb_flush_log_at_trx_commit }}
|
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 }}
|
sql_mode = {{ percona_sql_mode }}
|
||||||
|
|
||||||
# Authentication
|
# Authentication
|
||||||
mysql_native_password = ON
|
mysql_native_password = ON
|
||||||
|
|||||||
Reference in New Issue
Block a user