ansible-hardening role runs out of memory when running for ~60 nodes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack-Ansible |
Fix Released
|
Undecided
|
Jesse Pretorius |
Bug Description
I am using OSA 17.1.2 and the ansible-hardening role was eating up all my 11GB of memory in the deployment host which is weird. I found that the file ansible-
- include_tasks: accounts.yml
- include_tasks: aide.yml
- include_tasks: auditd.yml
- include_tasks: auth.yml
- include_tasks: file_perms.yml
- include_tasks: graphical.yml
- include_tasks: kernel.yml
- include_tasks: lsm.yml
- include_tasks: misc.yml
- include_tasks: sshd.yml
I got this error message when I ran ansible-hardening:
2018-10-26 11:52:51,266 p=677 u=root | Friday 26 October 2018 11:52:51 +0000 (0:00:14.270) 0:21:45.680 ********
2018-10-26 11:52:51,941 p=677 u=root | TASK [ansible-hardening : include_tasks] *******
2018-10-26 11:52:51,941 p=677 u=root | Friday 26 October 2018 11:52:51 +0000 (0:00:00.675) 0:21:46.355 ********
2018-10-26 11:52:57,589 p=677 u=root | included: /etc/ansible/
2018-10-26 11:53:30,166 p=677 u=root | TASK [ansible-hardening : Copy login warning banner] *******
2018-10-26 11:53:30,171 p=677 u=root | Friday 26 October 2018 11:53:30 +0000 (0:00:38.226) 0:22:24.585 ********
2018-10-26 11:53:30,209 p=677 u=root | ERROR! Unexpected Exception, this is probably a bug: [Errno 12] Cannot allocate memory
2018-10-26 11:53:30,209 p=677 u=root | to see the full traceback, use -vvv
2018-10-26 11:53:30,211 p=677 u=root | the full traceback was:
Traceback (most recent call last):
File "/opt/ansible-
exit_code = cli.run()
File "/opt/ansible-
results = pbex.run()
File "/opt/ansible-
result = self._tqm.
File "/opt/ansible-
play_return = strategy.
File "/opt/ansible-
self.
File "/etc/ansible/
_play_context
File "/opt/ansible-
worker_
File "/usr/lib/
self._popen = Popen(self)
File "/usr/lib/
self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
I realized huge memory increases when the tasks was doing include_tasks. I checked the imports with static import_tasks and the memory usage remained 1.5GB.
The Ansible related issue discussed here: https:/ /github. com/ansible/ ansible/ issues/ 30441 . I tried to use ansible v2.4.6 with OSA 17.1.2 but nothing changed, role still ran out of memory.