K
K
ksvdon2020-05-28 20:20:52
Ansible
ksvdon, 2020-05-28 20:20:52

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:
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

2 answer(s)
D
Dmitry, 2020-05-28
@q2digger

have you tried yum module instead of package ?


- name: ensure a list of packages installed
yum:
name: "{{ packages }}"
vars:
packages:
- httpd
- httpd-tools

M
MaxKozlov, 2020-05-28
@MaxKozlov

ansible has parameters from -v to -vvvv
, you can dig in that direction. and somewhere nearby there is an opportunity not to erase those scripts that it generates when executed.
but first of all I don't understand why delay: 100

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question