22 lines
430 B
YAML
22 lines
430 B
YAML
---
|
|
#
|
|
# Configure Docker
|
|
#
|
|
|
|
- name: Ensuring Docker status
|
|
service:
|
|
name: "docker"
|
|
state: started
|
|
|
|
- name: Determining Docker swarm status
|
|
shell: >
|
|
docker info | egrep 'Swarm: '
|
|
register: swarm_status
|
|
become: true
|
|
|
|
- name: Configuring Docker Swarm
|
|
shell: >
|
|
docker swarm init --advertise-addr "{{ ansible_default_ipv4.address }}"
|
|
when: "' Swarm: inactive' in swarm_status.stdout_lines"
|
|
become: true
|