41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
---
|
|
- name: Write script for calico/docker bridge configuration
|
|
template: src=create_cbr.j2 dest=/etc/network/if-up.d/create_cbr mode=u+x
|
|
when: overlay_network_plugin is defined and overlay_network_plugin == "calico"
|
|
|
|
- name: Configure calico/docker bridge
|
|
shell: /etc/network/if-up.d/create_cbr
|
|
when: overlay_network_plugin is defined and overlay_network_plugin == "calico"
|
|
|
|
- name: Configure docker to use cbr0 bridge
|
|
lineinfile:
|
|
dest=/etc/default/docker
|
|
regexp='.*DOCKER_OPTS=.*'
|
|
line='DOCKER_OPTS="--bridge=cbr0 --iptables=false --ip-masq=false"'
|
|
notify:
|
|
- restart docker
|
|
when: overlay_network_plugin is defined and overlay_network_plugin == "calico"
|
|
|
|
- name: enable docker
|
|
service:
|
|
name: docker
|
|
enabled: yes
|
|
state: started
|
|
tags:
|
|
- docker
|
|
|
|
- meta: flush_handlers
|
|
|
|
#- name: login to arkena's docker registry
|
|
# shell : >
|
|
# docker login --username={{ dockerhub_user }}
|
|
# --password={{ dockerhub_pass }}
|
|
# --email={{ dockerhub_email }}
|
|
|
|
#- pause: prompt='WARNING The next task will remove all exited containers, enter to continue'
|
|
#
|
|
#- name: Purge all exited containers
|
|
# shell: >
|
|
# if [ ! -z "$(docker ps -aq -f status=exited)" ]; then
|
|
# docker rm $(docker ps -aq -f status=exited);
|
|
# fi
|