419e560d2b
TrivialFix Change-Id: Ifa6432f24d4eaa354b977b71a6dbcd5f5080e1b0
87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
---
|
|
|
|
- name: Ensure docker service directory exists
|
|
file:
|
|
path=/etc/systemd/system/docker.service.d
|
|
state=directory
|
|
recurse=yes
|
|
become: True
|
|
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version > "14") or
|
|
(ansible_os_family == "RedHat") or (ansible_distribution == "Debian")
|
|
|
|
- name: configure docker service
|
|
become: True
|
|
template:
|
|
src=docker_systemd_service.j2
|
|
dest=/etc/systemd/system/docker.service.d/kolla.conf
|
|
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version > "14") or
|
|
(ansible_os_family == "RedHat") or (ansible_distribution == "Debian")
|
|
|
|
- name: reload docker service file
|
|
become: True
|
|
command: systemctl daemon-reload
|
|
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version > "14") or
|
|
(ansible_os_family == "RedHat") or (ansible_distribution == "Debian")
|
|
|
|
- name: configure docker service
|
|
become: True
|
|
template:
|
|
src=docker_defaults.j2
|
|
dest=/etc/default/docker
|
|
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "15")
|
|
|
|
- name: docker mount shared
|
|
command: mount --make-shared /run
|
|
become: True
|
|
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "15")
|
|
|
|
- name: get stat of libvirtd apparmor profile
|
|
stat: path=/etc/apparmor.d/usr.sbin.libvirtd
|
|
register: apparmor_libvirtd_profile
|
|
when: ansible_distribution == "Ubuntu"
|
|
|
|
- name: remove apparmor profile for libvirt
|
|
command: apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
|
|
become: True
|
|
when:
|
|
- ansible_distribution == "Ubuntu"
|
|
- apparmor_libvirtd_profile.stat.exists == True
|
|
|
|
- name: create docker group
|
|
group:
|
|
name: docker
|
|
become: True
|
|
|
|
- name: add kolla user to docker group
|
|
user:
|
|
name: kolla
|
|
append: yes
|
|
groups: docker
|
|
become: True
|
|
when: create_kolla_user | bool == True
|
|
|
|
- name: start docker
|
|
service:
|
|
name: docker
|
|
state: started
|
|
become: yes
|
|
|
|
- name: restart docker
|
|
service:
|
|
name: docker
|
|
state: restarted
|
|
become: yes
|
|
|
|
- name: enable docker
|
|
service:
|
|
name: docker
|
|
enabled: yes
|
|
become: yes
|
|
|
|
- name: reboot
|
|
command: reboot -f
|
|
become: yes
|
|
when:
|
|
- reboot_required is defined
|
|
- reboot_required | bool == true
|