Hello,
My playbook is in error when I use the package module to install packages in centOS machine. Someone has an idea of the problem?
Ansible version : 2.0.0.1
OS target machine : CentOS Linux release 7.2
my playbook (extract):
- name: Installing selinux-related packages
package:
name: “{{ item }}”
state: present
with_items: - libselinux-python
- selinux-policy
when: ansible_os_family == “RedHat”
The error message :
failed: [X.X.X.X] => (item=[u’libselinux-python’, u’selinux-policy’]) => {“failed”: true, “item”: [“libselinux-python”, “selinux-policy”], “module_stderr”: “”, “module_stdout”: “Traceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1459263288.84-116454324299460/yum", line 2769, in \r\n main()\r\n File "/root/.ansible/tmp/ansible-tmp-1459263288.84-116454324299460/yum", line 831, in main\r\n disablerepo, disable_gpg_check)\r\n File "/root/.ansible/tmp/ansible-tmp-1459263288.84-116454324299460/yum", line 716, in ensure\r\n items = pkgspec.split(‘,’)\r\nAttributeError: ‘list’ object has no attribute ‘split’\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
When I connected to the host and I do ‘yum install libselinux-python’, the package is already installed.
France