Skip to content

Commit 4cd6be3

Browse files
committed
Add compatibility with Archlinux
Add vars for Archlinux Install mariadb on Archlinux Add Archlinux as compatible system in meta
1 parent 0cc5e59 commit 4cd6be3

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

meta/main.yml

Lines changed: 3 additions & 0 deletions
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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 12 additions & 0 deletions
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

vars/Archlinux.yml

Lines changed: 12 additions & 0 deletions
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)