kolla-ansible/ansible/roles/mongodb/tasks/bootstrap_cluster.yml
Michal Nasiadka d403690b88 Ansible lint: lines longer than 160 chars
Change-Id: I500cc8800c412bc0e95edb15babad5c1189e6ee4
2020-04-16 15:59:06 +02:00

27 lines
856 B
YAML

---
- name: Copying the mongodb replication set bootstrap script
template:
src: bootstrap_cluster.js.j2
dest: /tmp/mongodb_bootstrap_replication_set.js
delegate_to: localhost
run_once: True
- name: Bootstrapping the mongodb replication set
become: true
command: >
docker exec -t mongodb mongo --host {{ api_interface_address }} --port {{ mongodb_port }} --quiet --eval
'{{ lookup('file','/tmp/mongodb_bootstrap_replication_set.js') }}'
register: bootstrap_mongodb_cluster
failed_when: (bootstrap_mongodb_cluster.stdout|from_json).ok != 1
delegate_to: "{{ groups['mongodb'][0] }}"
run_once: True
- name: Deleting the mongodb replication set bootstrap script
file:
path: /tmp/mongodb_bootstrap_replication_set.js
state: absent
delegate_to: localhost
changed_when: false
failed_when: false
run_once: True