Skip to content

Commit dcab413

Browse files
committed
Check idempotence and numa issues
1 parent 795833e commit dcab413

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mongodb_apt_key_id:
1010
"4.2": "E162F504A20CDF15827F718D4B7C549A058F8B6B"
1111

1212
mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager
13-
mongodb_pymongo_pip_version: 3.7.1
13+
mongodb_pymongo_pip_version: 3.11.3
1414

1515
mongodb_user_update_password: "on_create" # MongoDB user password update default policy
1616
mongodb_manage_service: true

tasks/install.debian.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@
5353
state: "{{ mongodb_package_state }}"
5454
update_cache: true
5555

56+
- name: Check if NUMA is available on host
57+
shell: "set -o pipefail && find /proc -name numa_maps | wc -l"
58+
args:
59+
executable: /bin/bash
60+
register: numa_number_lines
61+
changed_when: false
62+
check_mode: no
63+
when: mongodb_use_numa | bool
64+
65+
- name: Don't use NUMA if it is unavailable on host
66+
set_fact:
67+
mongodb_use_numa: false
68+
when: (mongodb_use_numa | bool and numa_number_lines.stdout | int == 0)
69+
5670
- name: Install numactl package
5771
apt:
5872
name: numactl
@@ -95,15 +109,23 @@
95109
- python-pip
96110
when: mongodb_pymongo_from_pip | bool
97111

112+
# TODO: check if it is still needed for Debian/Ubuntu
98113
- name: Install setuptools (required for ansible 2.7+)
99114
apt:
100115
pkg:
101116
- python-setuptools
102117
when: mongodb_pymongo_from_pip | bool
103118

119+
- name: Upgrade pip to the latest version
120+
pip:
121+
name: pip
122+
state: latest
123+
when: mongodb_pymongo_from_pip | bool
124+
104125
- name: Install PyMongo from PIP
105126
pip:
106-
name: pymongo
127+
name:
128+
- pymongo
107129
state: "{{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}"
108130
version: "{{ mongodb_pymongo_pip_version | default(omit) }}"
109131
when: mongodb_pymongo_from_pip | bool

0 commit comments

Comments
 (0)