ansible-role-mongodb/tasks/replication.yml

32 lines
1.3 KiB
YAML
Raw Normal View History

2015-02-10 12:45:13 +00:00
---
- name: Replication configuration
mongodb_replication:
2015-02-17 13:18:18 +00:00
login_host: "{{ mongodb_login_host|default('localhost') }}"
login_port: "{{ mongodb_login_port|default(27017) }}"
login_user: "{{ mongodb_root_admin_name }}"
login_password: "{{ mongodb_root_admin_password }}"
2016-04-17 13:43:00 +00:00
replica_set: "{{ mongodb_replication_replset }}"
host_name: "{{ item.host_name }}"
2015-02-17 13:18:18 +00:00
host_port: "{{ item.host_port|default(27017) }}"
host_type: "{{ item.host_type|default('replica') }}"
hidden: "{{ item.hidden|default(false) }}"
priority: "{{ item.priority|default(1.0) }}"
2016-04-17 13:43:00 +00:00
when: mongodb_security_authorization == 'enabled'
2015-02-17 13:18:18 +00:00
with_items:
- "{{ mongodb_replication_params|default([]) }}"
2015-02-17 13:18:18 +00:00
- name: Replication configuration without auth
mongodb_replication:
login_host: "{{ mongodb_login_host|default('localhost') }}"
login_port: "{{ mongodb_login_port|default(27017) }}"
2016-04-17 13:43:00 +00:00
replica_set: "{{ mongodb_replication_replset }}"
2015-02-17 13:18:18 +00:00
host_name: "{{ item.host_name }}"
host_port: "{{ item.host_port|default(27017) }}"
host_type: "{{ item.host_type|default('replica') }}"
hidden: "{{ item.hidden|default(false) }}"
priority: "{{ item.priority|default(1.0) }}"
2016-04-17 13:43:00 +00:00
when: mongodb_security_authorization == 'disabled'
2015-02-10 12:45:13 +00:00
with_items:
- "{{ mongodb_replication_params|default([]) }}"