forked from mrlesmithjr/ansible-mariadb-galera-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
151 lines (116 loc) · 5.4 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
# defaults file for ansible-mariadb-galera-cluster
# Define the cacti user info for cacti db monitoring - If used. May remove later.
cacti_db_password: "cactiuser"
cacti_db_user: "cactiuser"
# Defines if root logins should be allowed from any host
galera_allow_root_from_any: false
# Define bind address for galera cluster
galera_cluster_bind_address: "{{ hostvars[inventory_hostname]['ansible_' + galera_cluster_bind_interface]['ipv4']['address'] }}"
# Define interface in which to bind
# ex. eth0|eth1|enp0s3|enp0s8
galera_cluster_bind_interface: "enp0s8"
# Define the name of the cluster
galera_cluster_name: "vagrant-test"
# Define Ansible group in which the nodes exist to be part of the cluster
galera_cluster_nodes_group: "galera-cluster-nodes"
# Defines debian db password
# generate using echo password | mkpasswd -s -m sha-512
galera_deb_db_password: "{{ mariadb_mysql_root_password }}"
# Defines email address to receive notifications
galera_email_notifications: "notifications@{{ mariadb_smtp_domain_name }}"
# Defines if cacti monitoring should be enabled for mysql - If used. May remove later.
galera_enable_cacti_monitoring: false
galera_enable_galera_monitoring_script: false
# Defines if we should enable the MariaDB repo or use version within OS repos.
galera_enable_mariadb_repo: true
# https://mariadb.com/kb/en/mariadb/wsrep_provider_options/
galera_extra_wsrep_provider_options:
[]
# evs.auto_evict: 1
# evs.delayed_margin: 'PT5S'
# evs.delayed_keep_period: 'PT45S'
# Define which network segment this node is in.
# value is an integer from 0 to 255
# By default all nodes are placed in the same segment (0)
# http://galeracluster.com/documentation-webpages/galeraparameters.html#gmcast-segment
galera_gmcast_segment: "0"
# Address to listen on for Incremental State Transfer.
# By default this is the <address>:<port+1> from wsrep_node_address.
galera_ist_recv_addr: "{{ galera_cluster_bind_address }}"
galera_ist_recv_addr_port: "{{ galera_wsrep_node_address_port|int + 1 }}"
# This option defines the address to which the node will bind in order to
# receive Incremental State Transfers. When this option is not set, it takes
# its value from ist.recv_addr or, in the event that that is also not set,
# from wsrep_node_address. You may find it useful when the node runs behind a
# NAT or in similar cases where the public and private addresses differ.
galera_ist_recv_bind: "{{ galera_cluster_bind_address }}"
galera_monitor_script_name: "galeranotify.py"
galera_monitor_script_path: "/etc/mysql"
# Defines the which node should be considered the master in the cluster
# Used to bootstrap cluster
galera_mysql_master_node: "{{ groups[galera_cluster_nodes_group][0] }}"
# Define email address that cluster notifications will be sent from
galera_notify_mail_from: "galeranotify@{{ mariadb_smtp_domain_name }}"
# Define email address that cluster notification will be sent to
galera_notify_mail_to: "{{ galera_email_notifications }}"
# Define smtp server to send notifications through
galera_notify_smtp_server: "{{ mariadb_smtp_server }}"
# Defines if the cluster should be reconfigured
galera_reconfigure_galera: false
galera_wsrep_node_address: "{{ galera_cluster_bind_address }}:{{ galera_wsrep_node_address_port }}"
galera_wsrep_node_address_port: 4567
# MariaDB Repo Info
mariadb_debian_repo: "deb [arch=amd64,i386,ppc64el] http://nyc2.mirrors.digitalocean.com/mariadb/repo/{{ mariadb_version }}/{{ ansible_distribution|lower }} {{ ansible_distribution_release|lower }} main"
mariadb_debian_repo_key: "0xF1656F24C74CD1D8"
mariadb_debian_repo_keyserver: "keyserver.ubuntu.com"
mariadb_debian_repo_pin: nyc2.mirrors.digitalocean.com
mariadb_redhat_repo: "http://yum.mariadb.org/{{ mariadb_version }}/{{ ansible_distribution|lower }}{{ ansible_distribution_major_version|int }}-amd64"
mariadb_redhat_repo_key: "https://yum.mariadb.org/RPM-GPG-KEY-MariaDB"
mariadb_version: "10.1"
mariadb_mysql_mem_multiplier: .25
# Add the posibility to adjust the OOM score (only works for SystemD)
mariadb_oom_score_adjust: 0
# Add the posibility to adjust the LimitNOFILE (only works for SystemD)
# default: 0 does not tamper LimitNOFILE
# notice for SystemD: 0 does not mean 'unlimited', use 'infinity' for unlimited
mariadb_max_open_files: 0
# Define listen port
mariadb_mysql_port: 3306
# Define mysql root password
# generate using echo password | mkpasswd -s -m sha-512
mariadb_mysql_root_password: "root"
mariadb_mysql_settings:
datadir: /var/lib/mysql
expire_logs_days: 10
#Default is 16M
key_buffer_size: "{{ (ansible_memtotal_mb | int * mariadb_mysql_mem_multiplier) | round | int }}M"
max_allowed_packet: 16M
max_binlog_size: 100M
query_cache_limit: 1M
query_cache_size: 16M
thread_cache_size: 8
thread_stack: 192K
# If this is defined it will create a file with overrides
# mariadb_config_overrides:
# mariadb:
# max_connections: 2048
# Define additional MySQL users
mariadb_mysql_users: []
# - name: example
# hosts:
# - "%"
# - "127.0.0.1"
# - "::1"
# - "localhost"
# password: secret
# encrypted: no (default)
# priv: *.*:USAGE (default}
# state: present (default)
# append_privs: no (default)
# Define the primary domain name of your environment
mariadb_pri_domain_name: "example.org"
# Define smtp domain for email
mariadb_smtp_domain_name: "{{ mariadb_pri_domain_name }}"
# Define smtp server to send email through
mariadb_smtp_server: "smtp.{{ mariadb_pri_domain_name }}"