Modern Ansible

pull/35/head
Emilien Mantel 2019-04-12 09:38:42 +02:00
parent fb4c70827c
commit 1ec3b388a0
7 changed files with 20 additions and 19 deletions

View File

@ -1,12 +1,13 @@
env:
- PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4'
matrix:
allow_failures:
- env: PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4'
fast_finish: true
- PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.7,<2.7'
- PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.7,<2.7'
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.7,<2.7'
sudo: required

View File

@ -21,7 +21,7 @@ Notes
Requirements
------------
None.
Ansible 2.5+
Role Variables
--------------
@ -61,7 +61,7 @@ Check "priv" syntax in [mysql\_user module documentation](http://docs.ansible.co
### Packaging
- `mariadb_version`: 10.0 / 10.1 / 10.2
- `mariadb_version`: 10.0 / 10.1 / 10.2 / 10.3
- `mariadb_repository`: MariaDB upstream APT repository (see: [MariaDB repositories tool](https://downloads.mariadb.org/mariadb/repositories))
- `mariadb_percona_repository`: Percona upstream APT repository (see: [Percona APT doc](http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html))
- `mariadb_use_percona_apt`: Force using Percona APT repository (useful when you want to use latest version of percona toolkits, xtrabackup... etc)

View File

@ -4,7 +4,7 @@ galaxy_info:
description: Install and configure MariaDB (and Galera Cluster) on Debian
company:
license: GPLv2
min_ansible_version: 2.3
min_ansible_version: 2.5
platforms:
- name: Debian
versions:

View File

@ -4,7 +4,7 @@
apt_key:
keyserver: "{{ mariadb_key_server }}"
id: "{{ item }}"
with_items: "{{ mariadb_key_ids }}"
loop: "{{ mariadb_key_ids }}"
- name: TEMPLATE | Deploy APT pinning (prevent upgrades from Debian)
template:

View File

@ -61,7 +61,7 @@
mysql_db:
name: "{{ item }}"
state: present
with_items: "{{ mariadb_databases }}"
loop: "{{ mariadb_databases }}"
- name: MYSQL_USER | Manages users...
mysql_user:
@ -71,7 +71,7 @@
host: "{{ item.host | default(omit) }}"
host_all: "{{ item.host_all | default(omit) }}"
state: present
with_items: "{{ mariadb_users }}"
loop: "{{ mariadb_users }}"
- name: TEMPLATE | Deploy logrotate configuration
template:

View File

@ -5,7 +5,7 @@
name: root
host: "{{ item }}"
password: "{{ mariadb_root_password }}"
with_items:
loop:
- "{{ ansible_hostname }}"
- 127.0.0.1
- ::1
@ -16,7 +16,7 @@
name: ''
host: "{{ item }}"
state: absent
with_items:
loop:
- "{{ ansible_hostname }}"
- 127.0.0.1
- ::1

View File

@ -3,7 +3,7 @@
- hosts: all
tasks:
- apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600
with_items:
loop:
- ca-certificates
- curl
- strace
@ -16,7 +16,7 @@
- copy: src=import1.sql dest=/tmp/import1.sql
register: c
- mysql_db: name={{ item }} state=import target=/tmp/import1.sql
with_items: ['testrepl', 'norepl']
loop: ['testrepl', 'norepl']
when: c.changed
- hosts: slave
@ -37,7 +37,7 @@
delegate_to: "{{ mariadb_slave_import_from }}"
register: c
- mysql_db: name={{ item }} state=import target=/tmp/import2.sql
with_items: ['testrepl', 'norepl']
loop: ['testrepl', 'norepl']
delegate_to: "{{ mariadb_slave_import_from }}"
when: c.changed
- mysql_replication: mode=getslave