Skip to content

Commit ff03c65

Browse files
authored
Merge pull request geerlingguy#182 from Anthony25/master
Add compatibility with ArchLinux
2 parents 27e071d + 4cd6be3 commit ff03c65

File tree

5 files changed

+37
-2
lines changed

5 files changed

+37
-2
lines changed

meta/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ galaxy_info:
1818
- name: Debian
1919
versions:
2020
- all
21+
- name: Archlinux
22+
versions:
23+
- all
2124
galaxy_tags:
2225
- database

tasks/main.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
when: ansible_os_family == 'Debian'
1212
static: no
1313

14+
- include: setup-Archlinux.yml
15+
when: ansible_os_family == 'Archlinux'
16+
static: no
17+
1418
- name: Check if MySQL packages were installed.
1519
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) or (deb_mysql_install_packages is defined and deb_mysql_install_packages.changed) or (arch_mysql_install_packages is defined and arch_mysql_install_packages.changed) }}"
1721

1822
# Configure MySQL.
1923
- include: configure.yml

tasks/setup-Archlinux.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Ensure MySQL Python libraries are installed.
3+
pacman: "name=mysql-python state=present"
4+
5+
- name: Ensure MySQL packages are installed.
6+
pacman: "name={{ item }} state=present"
7+
with_items: "{{ mysql_packages }}"
8+
register: arch_mysql_install_packages
9+
10+
# Init the database if mysql is newly installed
11+
- command: mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
12+
when: arch_mysql_install_packages.changed

tasks/variables.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
---
22
# Variable configuration.
33
- name: Include OS-specific variables.
4-
include_vars: "{{ ansible_os_family }}.yml"
4+
include_vars: "{{ item }}"
5+
with_first_found:
6+
- files:
7+
- "vars/{{ ansible_os_family }}.yml"
8+
skip: true
59
when: ansible_os_family != "RedHat"
610

711
- name: Include OS-specific variables (RedHat).

vars/Archlinux.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
__mysql_daemon: mariadb
3+
__mysql_packages:
4+
- mariadb
5+
__mysql_slow_query_log_file: /var/log/mysql/mysql-slow.log
6+
__mysql_log_error: /var/log/mysql.err
7+
__mysql_syslog_tag: mysql
8+
__mysql_pid_file: /run/mysqld/mysqld.pid
9+
__mysql_config_file: /etc/mysql/my.cnf
10+
__mysql_config_include_dir: /etc/mysql/conf.d
11+
__mysql_socket: /run/mysqld/mysqld.sock
12+
__mysql_supports_innodb_large_prefix: true

0 commit comments

Comments
 (0)