Skip to content

Commit

Permalink
Add mongo host to tasks, do not use default (#69)
Browse files Browse the repository at this point in the history
* resolved conflicts

* Replace hard coded paths with variables

* Resolve conflict

* resolved conflicts

* Resolve conflicts

* Add mongo host to tasks, do not use default
  • Loading branch information
steven-schattenberg-itential authored Sep 21, 2024
1 parent 4ce3625 commit 22290bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roles/mongodb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
login_user: "{{ mongodb_auth_enabled is defined and mongodb_auth_enabled | ternary('admin', omit) }}"
login_password: "{{ mongodb_auth_enabled is defined and mongodb_auth_enabled | ternary(mongo_user_admin_password, omit) }}"
login_port: "{{ mongo_port }}"
login_host: "{{ inventory_hostname }}"
database: "{{ mongo_admin_db_name }}"
name: admin
password: "{{ mongo_user_admin_password }}"
Expand All @@ -222,6 +223,7 @@
login_user: "{{ mongodb_auth_enabled is defined and mongodb_auth_enabled | ternary('admin', omit) }}"
login_password: "{{ mongodb_auth_enabled is defined and mongodb_auth_enabled | ternary(mongo_user_admin_password, omit) }}"
login_port: "{{ mongo_port }}"
login_host: "{{ inventory_hostname }}"
database: "{{ mongo_itential_db_name }}"
user: itential
password: "{{ mongo_user_itential_password }}"
Expand All @@ -241,6 +243,7 @@
login_user: "{{ mongodb_auth_enabled is defined and mongodb_auth_enabled | ternary('admin', omit) }}"
login_password: "{{ mongodb_auth_enabled is defined and mongodb_auth_enabled | ternary(mongo_user_admin_password, omit) }}"
login_port: "{{ mongo_port }}"
login_host: "{{ inventory_hostname }}"
database: "{{ mongo_localaaa_db_name }}"
user: localaaa
password: "{{ mongo_user_localaaa_password }}"
Expand Down
1 change: 1 addition & 0 deletions roles/mongodb_common/tasks/check-auth-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
login_user: "{{ mongo_auth_enabled is defined and mongo_auth_enabled | ternary('admin', omit) }}"
login_password: "{{ mongo_auth_enabled is defined and mongo_auth_enabled | ternary(mongo_user_admin_password, omit) }}"
login_port: "{{ mongo_port }}"
login_host: "{{ inventory_hostname }}"
mongo_cmd: auto
db: admin
eval: "db.getUsers()"
Expand Down
2 changes: 2 additions & 0 deletions roles/mongodb_common/tasks/determine-primary-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
login_user: "{{ mongo_auth_enabled is defined and mongo_auth_enabled | ternary('admin', omit) }}"
login_password: "{{ mongo_auth_enabled is defined and mongo_auth_enabled | ternary(mongo_user_admin_password, omit) }}"
login_port: "{{ mongo_port }}"
login_host: "{{ inventory_hostname }}"
eval: "rs.status()"
register: rs_status_result
changed_when: false
Expand All @@ -31,6 +32,7 @@
login_user: "{{ mongo_auth_enabled is defined and mongo_auth_enabled | ternary('admin', omit) }}"
login_password: "{{ mongo_auth_enabled is defined and mongo_auth_enabled | ternary(mongo_user_admin_password, omit) }}"
login_port: "{{ mongo_port }}"
login_host: "{{ inventory_hostname }}"
replica_set: rs0
register: mongodb_status_result

Expand Down

0 comments on commit 22290bc

Please sign in to comment.