
Ansible for installing: Chef(host) Cobbler Compass Currently only three components being on the same host is supported. Change-Id: I1f36ee77546d3e5734a69660dde9edc41dc8ea13
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
- name: get all bridges
|
|
command: brctl show
|
|
register: bridges
|
|
|
|
- name: bring down docker0 if found
|
|
shell: ip link set dev docker0 down
|
|
when: bridges.stdout.find('docker0') != -1
|
|
|
|
- name: remove docker0 if found
|
|
shell: brctl delbr docker0
|
|
when: bridges.stdout.find('docker0') != -1
|
|
|
|
- name: bring down compass0 if found
|
|
shell: ip link set dev compass0 down
|
|
when: bridges.stdout.find('compass0') != -1
|
|
|
|
- name: remove compass0 if found
|
|
shell: brctl delbr compass0
|
|
when: bridges.stdout.find('compass0') != -1
|
|
|
|
- name: add bridge compass0
|
|
shell: brctl addbr compass0
|
|
|
|
- name: get compass0 info
|
|
command: ip addr
|
|
register: compass0_info
|
|
|
|
- name: add ip addr to compass0
|
|
shell: ip addr add {{ compass0_subnet }} dev compass0
|
|
when: compass0_info.stdout.find("{{ compass0_subnet }}") == -1
|
|
|
|
- name: bring up compass0
|
|
shell: ip link set dev compass0 up
|
|
|
|
- name: register compass0 to docker daemon
|
|
lineinfile: dest=/etc/sysconfig/docker regexp=^other_args line=other_args=-b=compass0
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
- name: register compass0 when it's debian
|
|
lineinfile: dest=/etc/default/docker line=DOCKER_OPTS=-b=compass0
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
- name: start docker daemon
|
|
service: name=docker state=started
|
|
|
|
- name: remove all containers
|
|
shell: docker rm -f $(docker ps -aq)
|
|
ignore_errors: yes
|