Skip to content

Commit

Permalink
variables ntp_package & ntp_service are not usable (override by OS-sp…
Browse files Browse the repository at this point in the history
…ecific vars). use mongodb_ntp_package & mongodb_ntp_service instead. (ansible-collections#589)
  • Loading branch information
beerfranz authored Jul 30, 2023
1 parent 57cb067 commit 6a4ba4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions roles/mongodb_linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ Role Variables
--------------

swappiness: OS swappiness value. Default "1".
ntp_package: Name of ntp package. Default ntp.
ntp_service: Name of ntp service. Default ntpd.
mongodb_ntp_package: Name of ntp package. Default depends on OS-specific vars.
mongodb_ntp_service: Name of ntp service. Default depends on OS-specific vars.
mongodb_gnu_c_lib: Name of the GNU C lib. Default depends on OS-specific vars.

* On RedHat 8 and higher systems ntp_package and ntp_service are set to chrony and chronyd respectively.

Expand Down
4 changes: 4 additions & 0 deletions roles/mongodb_linux/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ swappiness: "1"
nproc_and_nofile_limit: 64000
# TODO: mongo suggests infinity here
memlock_limit: 1024

mongodb_ntp_package:
mongodb_ntp_service:
mongodb_gnu_c_lib:
6 changes: 6 additions & 0 deletions roles/mongodb_linux/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
tags:
- "vars"

- name: "Override variables from OS-specific configuration"
set_fact:
ntp_package: "{{ mongodb_ntp_package | default(ntp_package, true) }}"
ntp_service: "{{ mongodb_ntp_service | default(ntp_service, true) }}"
gnu_c_lib: "{{ mongodb_gnu_c_lib | default(gnu_c_lib, true) }}"

- name: See if we are in docker
when:
- "ansible_facts.virtualization_role == 'guest'"
Expand Down

0 comments on commit 6a4ba4b

Please sign in to comment.