ansible/lib/ansible
Adam Miller 8c43697e3b yum - only instantiate YumBase once (#63713)
* yum - only instantiate YumBase once

Previously, this code was re-instantiating the `YumBase` object
many times which is unnecessary and slow. However, we must do it
twice in the `state: absent` case because the `yumSack` and
`rpmSack` data of the previously instantiated object becomes
invalid and is no longer useful post transaction when we verify
that the package removal did in fact take place. Also, this patch
removes the repetitive re-processing of enable/disable of repos in
various places.

Here's a display of the speed increase against a RHEL7 host:

```yaml
- hosts: rhel7
  remote_user: root
  tasks:
  - name: Install generic packages
    yum:
      state: present
      name:
        - iptraf-ng
        - screen
        - erlang
  - name: Remove generic packages
    yum:
      state: absent
      name:
        - iptraf-ng
        - screen
        - erlang
```

Before this patch:
```
real    0m52.728s
user    0m5.645s
sys     0m0.482s
```

After this patch:
```
real    0m17.139s
user    0m3.238s
sys     0m0.277s
```

Fixes #63588
Fixes #63551

Signed-off-by: Adam Miller <admiller@redhat.com>

* add changelog

Signed-off-by: Adam Miller <admiller@redhat.com>
2019-10-23 03:34:13 -04:00
..
cli Fixes --version in ansible-galaxy cli 2019-10-17 08:12:49 -07:00
compat Update bundled copy of selectors2 from 1.1.0 to 1.1.1 (#55457) 2019-04-23 11:52:24 -05:00
config Map Extreme Network OSes to their facts modules (#63574) 2019-10-22 08:57:11 -04:00
errors Catch sshpass authentication errors and don't retry multiple times to prevent account lockout (#50776) 2019-01-23 11:32:25 -05:00
executor Explicitly use multiprocessing fork start method (#63581) 2019-10-16 15:30:50 -05:00
galaxy Prevent generating roles that do not pass linting (#63709) 2019-10-22 11:26:07 -04:00
inventory Account for empty strings when splitting the host pattern (#62442) 2019-09-20 16:03:51 -04:00
module_utils XenServer: Update docs with recent changes in XenAPI python lib and branding (#63728) 2019-10-22 21:04:16 +05:30
modules yum - only instantiate YumBase once (#63713) 2019-10-23 03:34:13 -04:00
parsing Add a representer for AnsibleUnsafeBytes (#62598) 2019-09-19 14:27:48 -04:00
playbook
plugins Bug fixes- Dellos modules (#63272) 2019-10-22 14:06:34 +05:30
template Wrap CLI Passwords with AnsibleUnsafeText, ensure unsafe context is not lost during encode/decode (#63351) 2019-10-11 09:17:10 -05:00
utils Explicitly use multiprocessing fork start method (#63581) 2019-10-16 15:30:50 -05:00
vars Use correct delegate_to hostnames in loops (#59659) 2019-07-30 09:46:29 +02:00
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
constants.py removed previouslly deprecated settings (#55662) 2019-05-15 16:36:30 -04:00
context.py Become plugins (#50991) 2019-02-11 11:27:44 -06:00
release.py Update release name for 2.10 2019-09-05 18:36:06 -07:00