Yum Module Pending Transaction Error

I am very new to Ansible. I am trying to follow the Ansible Role Concept Guide. I have the following master book:

--- # Master Playbook for Webservers
- hosts: apacheweb
  user: test
  sudo: yes
  connection: ssh
  roles:
    - webservers

Which refers to the web server role, which has the following /main.yml task:

- name: Install Apache Web Server
  yum: pkg=httpd state=latest
  notify: Restart HTTPD

And the /main.yml handler:

- name: Restart HTTPD
  service: name=httpd state=started

When I execute the master book mentioned above, I get the following error:

TASK [webservers : Install Apache Web Server] **********************************
fatal: [test.server.com]: FAILED! => {"changed": false, "failed": true, "msg": "The following packages have pending transactions: httpd-x86_64", "rc": 128, "results": ["The following packages have pending transactions: httpd-x86_64"]}

I cannot figure out what corresponds to this error. In my opinion, it seems that nothing like this was similar to my research, which could offer a problem with the way I use the Yum module.

NOTE: Possible version:

ansible 2.2.1.0
  config file = /etc/ansible/ansible.cfg
+4
source share
3 answers

, / . yum-utils yum-complete-transaction , .

# yum-complete-transaction --cleanup-only

. .

yum-complete-transaction - , yum . *, /var/lib/yum, yum .

, . , .

+11

config playbooks:

- name: Install Apache Web Server
  yum: name=httpd state=latest
  notify: Restart HTTPD

, , yum: pkg=httpd ansbile yum ( , pkg = httpd apt-get debian )

, - :

- name: "Install httpd packages"
  yum: name={{ item }} state=present
  with_items:
    - httpd
    - httpd-devel
    - httpd-tools

, state = present state = latest ,

http://docs.ansible.com/ansible/yum_module.html - yum

0

sudo yum install yum-utils

yum-complete-transaction -cleanup-only

0

Source: https://habr.com/ru/post/1668796/


All Articles