Skip to content

Commit

Permalink
Resolved code review items
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-schattenberg-itential committed Sep 18, 2024
1 parent b0d61c1 commit 4643453
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions roles/mongodb/tasks/configure-selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
name: selinux

- name: Allow mongodb to listen on tcp port when using non-standard mongo port
when:
- ansible_selinux.status == "enabled"
- mongo_port != 27017
community.general.seport:
ports: "{{ mongo_port }}"
proto: tcp
setype: mongod_port_t
state: present
when:
- ansible_selinux.status == "enabled"
- mongo_port != 27017

# MongoDB is configured to use non-default paths for its data and log
# directories. First, we need to update the SELinux policy to allow the
Expand Down
6 changes: 3 additions & 3 deletions roles/mongodb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@
# This creates the admin user that has root access to the database
- name: Add admin user to database
community.mongodb.mongodb_user:
login_port: "{{ mongo_port }}"
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 }}"
database: "{{ mongo_admin_db_name }}"
name: admin
password: "{{ mongo_user_admin_password }}"
Expand All @@ -219,9 +219,9 @@
# itential database. It is used by IAP to connect to the db.
- name: Add itential user to database
community.mongodb.mongodb_user:
login_port: "{{ mongo_port }}"
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 }}"
database: "{{ mongo_itential_db_name }}"
user: itential
password: "{{ mongo_user_itential_password }}"
Expand All @@ -238,9 +238,9 @@
# LocalAAA database. It is used by the local AAA adapter to login to IAP.
- name: Add localaaa user to database
community.mongodb.mongodb_user:
login_port: "{{ mongo_port }}"
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 }}"
database: "{{ mongo_localaaa_db_name }}"
user: localaaa
password: "{{ mongo_user_localaaa_password }}"
Expand Down

0 comments on commit 4643453

Please sign in to comment.