Merge pull request #48 from rapkin/master

Fixed "ERROR! 'mongodb_replication_params' is undefined"
This commit is contained in:
Sergei Antipov 2016-02-03 13:13:39 +05:00
commit 45da87de3d
2 changed files with 6 additions and 4 deletions

View File

@ -14,7 +14,7 @@
priority: "{{ item.priority|default(1.0) }}" priority: "{{ item.priority|default(1.0) }}"
when: mongodb_conf_auth and mongodb_replication_params is defined when: mongodb_conf_auth and mongodb_replication_params is defined
with_items: with_items:
- "{{ mongodb_replication_params }}" - "{{ mongodb_replication_params|default([]) }}"
- name: Replication configuration without auth - name: Replication configuration without auth
mongodb_replication: mongodb_replication:
@ -28,4 +28,4 @@
priority: "{{ item.priority|default(1.0) }}" priority: "{{ item.priority|default(1.0) }}"
when: not mongodb_conf_auth and mongodb_replication_params is defined when: not mongodb_conf_auth and mongodb_replication_params is defined
with_items: with_items:
- "{{ mongodb_replication_params }}" - "{{ mongodb_replication_params|default([]) }}"

View File

@ -11,8 +11,9 @@
host_type: "{{ item.host_type|default('replica') }}" host_type: "{{ item.host_type|default('replica') }}"
hidden: "{{ item.hidden|default(false) }}" hidden: "{{ item.hidden|default(false) }}"
priority: "{{ item.priority|default(1.0) }}" priority: "{{ item.priority|default(1.0) }}"
when: mongodb_replication_params is defined
with_items: with_items:
- "{{ mongodb_replication_params }}" - "{{ mongodb_replication_params|default([]) }}"
register: mongodb_replica_init register: mongodb_replica_init
ignore_errors: true ignore_errors: true
@ -31,6 +32,7 @@
host_type: "{{ item.host_type|default('replica') }}" host_type: "{{ item.host_type|default('replica') }}"
hidden: "{{ item.hidden|default(false) }}" hidden: "{{ item.hidden|default(false) }}"
priority: "{{ item.priority|default(1.0) }}" priority: "{{ item.priority|default(1.0) }}"
when: mongodb_replication_params is defined
with_items: with_items:
- "{{ mongodb_replication_params }}" - "{{ mongodb_replication_params|default([]) }}"
when: mongodb_replica_init|failed when: mongodb_replica_init|failed