Xicheng Chang fa5f106bf6 Revert "Retire stackforge/compass-install"
This reverts commit 2614e5fa95aab680fb6f9287831e50c65f76f72c.

The repository is actually maintained, the authors merely
misunderstood the stackforge namespace retirement maintenance
announcements[1] and didn't realize they needed to notify us of that
status. Reverting the repository to its former state in preparation
for a namespace move in a coming project rename maintenance.

[1] http://lists.openstack.org/pipermail/openstack-infra/2015-August/003119.html

Change-Id: I6ccdcd8f8a084711c265e42c77b3b4159af27b24
2015-11-03 17:37:20 -08:00

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