Add matrix_docker_package_name

This commit is contained in:
Dan Arnfield 2019-11-18 11:29:14 -06:00
parent 80cfb2a93e
commit 960088752c
4 changed files with 16 additions and 18 deletions

View file

@ -42,10 +42,14 @@ matrix_docker_network: "matrix"
# matrix domain (`matrix_server_fqn_matrix`).
matrix_well_known_matrix_server_enabled: true
# Controls whether docker is automatically installed.
# If you change this to false you must install and update docker manually.
# Controls whether Docker is automatically installed.
# If you change this to false you must install and update Docker manually.
matrix_docker_installation_enabled: true
# Controls the Docker package that is installed.
# Possible values are "docker-ce" (default) and "docker.io" (Debian).
matrix_docker_package_name: docker-ce
# Variables to Control which parts of our roles run.
run_postgres_import: true
run_postgres_upgrade: true

View file

@ -1,11 +1,5 @@
---
- name: Gather package facts
package_facts:
- set_fact:
run_docker_installation: "{{ matrix_docker_installation_enabled|bool and 'docker.io' not in ansible_facts.packages }}"
- include_tasks: "{{ role_path }}/tasks/server_base/setup_centos.yml"
when: ansible_distribution == 'CentOS'

View file

@ -9,13 +9,13 @@
mode: 0644
with_items:
- docker-ce.repo
when: run_docker_installation|bool
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker's RPM key is trusted
rpm_key:
state: present
key: https://download.docker.com/linux/centos/gpg
when: run_docker_installation|bool
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure yum packages are installed
yum:
@ -27,10 +27,10 @@
state: latest
update_cache: yes
- name: Ensure docker-ce is installed
- name: Ensure Docker is installed
yum:
name:
- docker-ce
- "{{ matrix_docker_package_name }}"
state: latest
update_cache: yes
when: run_docker_installation|bool
when: matrix_docker_installation_enabled|bool

View file

@ -15,14 +15,14 @@
state: present
register: add_repository_key
ignore_errors: true
when: run_docker_installation|bool
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker repository is enabled
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable"
state: present
update_cache: yes
when: run_docker_installation|bool
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure APT packages are installed
apt:
@ -34,10 +34,10 @@
state: latest
update_cache: yes
- name: Ensure docker-ce is installed
- name: Ensure Docker is installed
apt:
name:
- docker-ce
- "{{ matrix_docker_package_name }}"
state: latest
update_cache: yes
when: run_docker_installation|bool
when: matrix_docker_installation_enabled|bool