41c93a403d
ansible_facts should be used instead of the injected vars Change-Id: I9e6e0a257d8abf844063b257b3d9026ec8c9ce6c
31 lines
792 B
YAML
31 lines
792 B
YAML
---
|
|
- name: Install and Start Docker
|
|
when:
|
|
- ansible_facts['distribution'] == "CentOS"
|
|
- ansible_facts['distribution_major_version']|int < 8
|
|
become: true
|
|
block:
|
|
|
|
- name: Install Docker
|
|
package:
|
|
name: docker
|
|
state: present
|
|
register: container_registry_docker_install
|
|
|
|
# Workaround for https://bugs.launchpad.net/tripleo/+bug/1845166/
|
|
- name: Disable docker iptables
|
|
when: container_registry_docker_disable_iptables
|
|
ini_file:
|
|
path: /etc/sysconfig/docker-network
|
|
section: null
|
|
option: DOCKER_NETWORK_OPTIONS
|
|
value: --iptables=false
|
|
no_extra_spaces: true
|
|
mode: '0644'
|
|
|
|
- name: Start Docker daemon
|
|
service:
|
|
name: docker
|
|
enabled: true
|
|
state: started
|