You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-3Lines changed: 32 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,19 +18,25 @@ No special requirements; note that this role requires root access, so either run
18
18
Available variables are listed below, along with default values (see `defaults/main.yml`):
19
19
20
20
mysql_user_home: /root
21
+
mysql_user_name: root
22
+
mysql_user_password: root
21
23
22
-
The home directory inside which Python MySQL settings will be stored, which Ansible will use when connecting to MySQL. This should be the home directory of the user which runs this Ansible role.
24
+
The home directory inside which Python MySQL settings will be stored, which Ansible will use when connecting to MySQL. This should be the home directory of the user which runs this Ansible role. The `mysql_user_name` and `mysql_user_password` can be set if you are running this role under a non-root user account and want to set a non-root user.
23
25
26
+
mysql_root_home: /root
27
+
mysql_root_username: root
24
28
mysql_root_password: root
25
29
26
-
The MySQL root user account password.
30
+
The MySQL root user account details.
27
31
28
32
mysql_root_password_update: no
29
33
30
34
Whether to force update the MySQL root user's password. By default, this role will only change the root user's password when MySQL is first configured. You can force an update by setting this to `yes`.
31
35
32
36
> Note: If you get an error like `ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)` after a failed or interrupted playbook run, this usually means the root password wasn't originally updated to begin with. Try either removing the `.my.cnf` file inside the configured `mysql_user_home` or updating it and setting `password=''` (the insecure default password). Run the playbook again, with `mysql_root_password_update` set to `yes`, and the setup should complete.
33
37
38
+
> Note: If you get an error like `ERROR 1698 (28000): Access denied for user 'root'@'localhost' (using password: YES)` when trying to log in from the CLI you might need to run as root or sudoer.
39
+
34
40
mysql_enabled_on_startup: yes
35
41
36
42
Whether MySQL should be enabled on startup.
@@ -103,6 +109,29 @@ The rest of the settings in `defaults/main.yml` control MySQL's memory usage and
103
109
104
110
Replication settings. Set `mysql_server_id` and `mysql_replication_role` by server (e.g. the master would be ID `1`, with the `mysql_replication_role` of `master`, and the slave would be ID `2`, with the `mysql_replication_role` of `slave`). The `mysql_replication_user` uses the same keys as `mysql_users`, and is created on master servers, and used to replicate on all the slaves.
105
111
112
+
### Later versions of MySQL on CentOS 7
113
+
114
+
If you want to install MySQL from the official repository instead of installing the system default MariaDB equivalents, you can add the following `pre_tasks` task in your playbook:
This role works with either MySQL or a compatible version of MariaDB. On RHEL/CentOS 7+, the mariadb database engine was substituted as the default MySQL replacement package. No modifications are necessary though all of the variables still reference 'mysql' instead of mariadb.
@@ -148,4 +177,4 @@ MIT / BSD
148
177
149
178
## Author Information
150
179
151
-
This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
180
+
This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
Copy file name to clipboardExpand all lines: tasks/main.yml
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,15 @@
11
11
when: ansible_os_family == 'Debian'
12
12
static: no
13
13
14
+
- include: setup-Archlinux.yml
15
+
when: ansible_os_family == 'Archlinux'
16
+
static: no
17
+
14
18
- name: Check if MySQL packages were installed.
15
19
set_fact:
16
-
mysql_install_packages: "{{ (rh_mysql_install_packages is defined and rh_mysql_install_packages.changed) or (deb_mysql_install_packages is defined and deb_mysql_install_packages.changed) }}"
20
+
mysql_install_packages: "{{ (rh_mysql_install_packages is defined and rh_mysql_install_packages.changed)
21
+
or (deb_mysql_install_packages is defined and deb_mysql_install_packages.changed)
22
+
or (arch_mysql_install_packages is defined and arch_mysql_install_packages.changed) }}"
0 commit comments