Allow more options in replication params

This commit is contained in:
Nicolas Boutet 2019-05-15 16:16:11 +02:00
parent 45309059e9
commit 97ab03f81f
2 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@
- name: Replication configuration - name: Replication configuration
mongodb_replication: mongodb_replication:
build_indexes: "{{ item.build_indexes|default(omit) }}"
login_host: "{{ mongodb_login_host|default('localhost') }}" login_host: "{{ mongodb_login_host|default('localhost') }}"
login_port: "{{ mongodb_login_port|default(27017) }}" login_port: "{{ mongodb_login_port|default(27017) }}"
login_user: "{{ mongodb_root_admin_name }}" login_user: "{{ mongodb_root_admin_name }}"
@ -12,12 +13,14 @@
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) }}"
votes: "{{ item.votes|default(omit) }}"
when: mongodb_security_authorization == 'enabled' when: mongodb_security_authorization == 'enabled'
with_items: with_items:
- "{{ mongodb_replication_params|default([]) }}" - "{{ mongodb_replication_params|default([]) }}"
- name: Replication configuration without auth - name: Replication configuration without auth
mongodb_replication: mongodb_replication:
build_indexes: "{{ item.build_indexes|default(omit) }}"
login_host: "{{ mongodb_login_host|default('localhost') }}" login_host: "{{ mongodb_login_host|default('localhost') }}"
login_port: "{{ mongodb_login_port|default(27017) }}" login_port: "{{ mongodb_login_port|default(27017) }}"
replica_set: "{{ mongodb_replication_replset }}" replica_set: "{{ mongodb_replication_replset }}"
@ -26,6 +29,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) }}"
votes: "{{ item.votes|default(omit) }}"
when: mongodb_security_authorization == 'disabled' when: mongodb_security_authorization == 'disabled'
with_items: with_items:
- "{{ mongodb_replication_params|default([]) }}" - "{{ mongodb_replication_params|default([]) }}"

View File

@ -1,6 +1,7 @@
--- ---
- name: Replication configuration | 1st Pt. - name: Replication configuration | 1st Pt.
mongodb_replication: mongodb_replication:
build_indexes: "{{ item.build_indexes|default(omit) }}"
login_host: "{{ mongodb_login_host|default('localhost') }}" login_host: "{{ mongodb_login_host|default('localhost') }}"
login_port: "{{ mongodb_net_port|default(27017) }}" login_port: "{{ mongodb_net_port|default(27017) }}"
login_user: "{{ mongodb_root_admin_name }}" login_user: "{{ mongodb_root_admin_name }}"
@ -11,6 +12,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) }}"
votes: "{{ item.votes|default(omit) }}"
with_items: with_items:
- "{{ mongodb_replication_params|default([]) }}" - "{{ mongodb_replication_params|default([]) }}"
register: mongodb_replica_init register: mongodb_replica_init
@ -21,6 +23,7 @@
- name: Replication configuration | 2nd Pt - name: Replication configuration | 2nd Pt
mongodb_replication: mongodb_replication:
build_indexes: "{{ item.build_indexes|default(omit) }}"
login_host: "{{ mongodb_login_host|default('localhost') }}" login_host: "{{ mongodb_login_host|default('localhost') }}"
login_port: "{{ mongodb_net_port|default(27017) }}" login_port: "{{ mongodb_net_port|default(27017) }}"
login_user: "{{ mongodb_root_admin_name }}" login_user: "{{ mongodb_root_admin_name }}"
@ -31,6 +34,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) }}"
votes: "{{ item.votes|default(omit) }}"
when: mongodb_replica_init|failed when: mongodb_replica_init|failed
with_items: with_items:
- "{{ mongodb_replication_params|default([]) }}" - "{{ mongodb_replication_params|default([]) }}"