Answer the question
In order to leave comments, you need to log in
It takes too long to install packages using the ansible role, how to track down the cause?
I put a certain package on CentOS6, CentOS7 operating systems.
On the seven, the package is installed in about a minute. On 6ku from 8 to 13 minutes. It looks like the ansible role is simply not being fulfilled, perhaps something is interfering with it.
If you put it directly on the car - everything is fast on both 6k and 7k. It's stupid to access remote hosts via ssh - probably not an option, because. there are a lot of machines, like ansible is the most convenient. Tell me, where is it better to look at the reason that prevents the roles from working out, according to the log something is not clear, it hangs stupidly for 10 minutes, and then it gives the result.
The role looks like this:
---
- name: Installation of packages
package:
name: "{{ packages_for_testing.split(' ') }}"
state: latest
register: result
until: result.rc == 0
retries: 3
delay: 100
when: packages_for_testing is defined
ansible --version
ansible 2.9.7
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Nov 13 2019, 08:27:45) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]
Answer the question
In order to leave comments, you need to log in
have you tried yum module instead of package ?
- name: ensure a list of packages installed
yum:
name: "{{ packages }}"
vars:
packages:
- httpd
- httpd-tools
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question