Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Debian derivatives #67

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tasks/add-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
src: etc_yum.repos.d_mariadb.repo.j2
dest: /etc/yum.repos.d/MariaDB.repo
mode: '0644'
when: ansible_distribution != 'Debian'
when: ansible_os_family != 'Debian'
tags: mariadb


- name: Install gpg to add repokey (apt)
package:
name: gpg
state: latest
when: ansible_distribution == 'Debian'
when: ansible_os_family == 'Debian'
tags: mariadb

- name: Add official MariaDB repository key (apt)
apt_key:
url: https://mariadb.org/mariadb_release_signing_key.asc
state: present
when: ansible_distribution == 'Debian'
when: ansible_os_family == 'Debian'
tags: mariadb

- name: Add official MariaDB repository (apt)
template:
src: etc_apt_sources.list.d_mariadb.list.j2
dest: /etc/apt/sources.list.d/mariadb.list
mode: '0644'
when: ansible_distribution == 'Debian'
when: ansible_os_family == 'Debian'
tags: mariadb

- name: Update packages cache with new repo (apt)
apt:
update_cache: true
when: ansible_distribution == 'Debian'
when: ansible_os_family == 'Debian'
tags: mariadb
2 changes: 1 addition & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
- name: Install packages
package:
name: "{{ mariadb_packages }}"
state: "{{ 'latest' if ansible_distribution == 'Debian' else 'installed' }}"
state: "{{ 'latest' if ansible_os_family == 'Debian' else 'installed' }}"
tags: mariadb
4 changes: 2 additions & 2 deletions templates/etc_apt_sources.list.d_mariadb.list.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MariaDB repository list - Ansible managed
# http://downloads.mariadb.org/mariadb/repositories/
deb [arch=amd64] http://{{ mariadb_mirror }}/{{ mariadb_version }}/debian {{ ansible_distribution_release }} main
deb-src http://{{ mariadb_mirror }}/{{ mariadb_version }}/debian {{ ansible_distribution_release }} main
deb [arch=amd64] https://{{ mariadb_mirror }}/{{ mariadb_version }}/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} main
deb-src https://{{ mariadb_mirror }}/{{ mariadb_version }}/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} main
2 changes: 1 addition & 1 deletion templates/etc_logrotate.d_mysql.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{ ansible_managed }}

# This logname can be set in /etc/{{ 'mysql/' if ansible_distribution == 'Debian' else '' }}my.cnf
# This logname can be set in /etc/{{ 'mysql/' if ansible_os_family == 'Debian' else '' }}my.cnf
# by setting the variable "log-error"
# in the [mysqld] section as follows:
#
Expand Down
2 changes: 0 additions & 2 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ mariadb_packages:
- mariadb-server
- python3-pymysql

mariadb_mirror: mirror.mva-n.net/mariadb/repo

mariadb_socket: /run/mysqld/mysqld.sock

mariadb_config_directory: /etc/mysql/mariadb.conf.d
Expand Down