2015-06-22 08:59:25 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Replication configuration
|
|
|
|
mongodb_replication:
|
2015-06-25 11:33:19 +00:00
|
|
|
login_host: "{{ mongodb_login_host|default('localhost') }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
login_port: "{{ mongodb_conf_port|default(27017) }}"
|
|
|
|
login_user: "{{ mongodb_root_admin_name }}"
|
|
|
|
login_password: "{{ mongodb_root_admin_password }}"
|
|
|
|
replica_set: "{{ mongodb_conf_replSet }}"
|
|
|
|
host_name: "{{ item.host_name }}"
|
|
|
|
host_port: "{{ item.host_port|default(27017) }}"
|
|
|
|
host_type: "{{ item.host_type|default('replica') }}"
|
|
|
|
with_items:
|
|
|
|
- "{{ mongodb_replication_params }}"
|
|
|
|
register: mongodb_replica_init
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- include: auth_initialization.yml
|
|
|
|
when: mongodb_replica_init|failed
|
|
|
|
|
|
|
|
- name: Replication configuration
|
|
|
|
mongodb_replication:
|
2015-06-25 11:33:19 +00:00
|
|
|
login_host: "{{ mongodb_login_host|default('localhost') }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
login_port: "{{ mongodb_conf_port|default(27017) }}"
|
|
|
|
login_user: "{{ mongodb_root_admin_name }}"
|
|
|
|
login_password: "{{ mongodb_root_admin_password }}"
|
|
|
|
replica_set: "{{ mongodb_conf_replSet }}"
|
|
|
|
host_name: "{{ item.host_name }}"
|
|
|
|
host_port: "{{ item.host_port|default(27017) }}"
|
|
|
|
host_type: "{{ item.host_type|default('replica') }}"
|
|
|
|
with_items:
|
|
|
|
- "{{ mongodb_replication_params }}"
|
|
|
|
when: mongodb_replica_init|failed
|