Pin MariaDB packages

pull/18/head
Jasper N. Brouwer 2017-07-03 15:24:01 +02:00
parent 5977497809
commit 3535d8b43a
3 changed files with 14 additions and 4 deletions

View File

@ -127,8 +127,9 @@ mysql_users: []
# MariaDB # MariaDB
# ------------------------------------- # -------------------------------------
mysql_mariadb_version: '10.1' mysql_mariadb_version: '10.1'
mysql_mariadb_mirror_domain: "ftp.igh.cnrs.fr"
# See: https://downloads.mariadb.org/mariadb/repositories # See: https://downloads.mariadb.org/mariadb/repositories
mysql_mariadb_repository: "http://ftp.igh.cnrs.fr/pub/mariadb/repo/{{ mysql_mariadb_version }}/debian" mysql_mariadb_repository: "http://{{ mysql_mariadb_mirror_domain }}/pub/mariadb/repo/{{ mysql_mariadb_version }}/debian"
mysql_mariadb_key_server: "keyserver.ubuntu.com" mysql_mariadb_key_server: "keyserver.ubuntu.com"
mysql_mariadb_key_ids: ['0xcbcb082a1bb943db', '0xf1656f24c74cd1d8'] mysql_mariadb_key_ids: ['0xcbcb082a1bb943db', '0xf1656f24c74cd1d8']

View File

@ -1,13 +1,16 @@
--- ---
- name: APT | Install MariaDB key - name: APT_KEY | Install MariaDB key
apt_key: keyserver="{{ mysql_mariadb_key_server }}" id={{ item }} state=present apt_key: keyserver="{{ mysql_mariadb_key_server }}" id={{ item }} state=present
with_items: "{{ mysql_mariadb_key_ids }}" with_items: "{{ mysql_mariadb_key_ids }}"
- name: APT | Add MariaDB repository - name: TEMPLATE | Deploy APT pinning (prevent upgrades from Debian)
template: src=etc/apt/preferences.d/95-mariadb.j2 dest=/etc/apt/preferences.d/95-mariadb
- name: APT_REPOSITORY | Add MariaDB repository
apt_repository: repo='deb {{ mysql_mariadb_repository }} {{ ansible_distribution_release }} main' state=present apt_repository: repo='deb {{ mysql_mariadb_repository }} {{ ansible_distribution_release }} main' state=present
- name: APT | Add MariaDB (src) repository - name: APT_REPOSITORY | Add MariaDB (src) repository
apt_repository: repo='deb-src {{ mysql_mariadb_repository }} {{ ansible_distribution_release }} main' state=present apt_repository: repo='deb-src {{ mysql_mariadb_repository }} {{ ansible_distribution_release }} main' state=present
when: mysql_upstream_apt_src when: mysql_upstream_apt_src

View File

@ -0,0 +1,6 @@
# {{ ansible_managed }}
Explanation: Prevent Debian upgrades on mariadb packages
Package: *
Pin: origin {{ mysql_mariadb_mirror_domain }}
Pin-Priority: 1000