Bug 1374491

Summary: ansible-node group for dnf does not contain libselinux-python
Product: [Fedora] Fedora Reporter: Steve Kuznetsov <skuznets>
Component: ansibleAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 24CC: a.badger, athmanem, kevin, kupo, mark, maxim, toromoti
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-08 20:17:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
sample playbook none

Description Steve Kuznetsov 2016-09-08 20:10:40 UTC
Created attachment 1199193 [details]
sample playbook

Description of problem:
The `ansible-node` group, which is created to try to contain all of the dependencies necessary to get a remote host to be a valid target for Ansible, does not contain `libselinux-python`, which is a necessary dependency if the target host has SELinux.

How reproducible:
Run a playbook against a Fedora 24 host with the `ansible-node` group but without `libselinux-python`.

Steps to Reproduce:
# on remote F24 host
$ dnf group install -y ansible-node
# locally
$ cat <<EOF >playbook.yml
---
- name: try to run a playbook without SELinux bindings
  hosts: hostname
  become: yes
  become_method: sudo
  become_user: root

  tasks:
    - lineinfile:
        dest: /etc/yum.conf
        line: '# comment'
        state: present
        create: true
EOF
$ cat <<EOF >inventory
hostname
EOF
$ ansible-playbook -i inventory playbook.yml

Actual results:
PLAY [try to run a playbook without SELinux bindings] **************************

TASK [setup] *******************************************************************
ok: [openshiftdevel]

TASK [lineinfile] **************************************************************
fatal: [openshiftdevel]: FAILED! => {"changed": false, "failed": true, "msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"}

NO MORE HOSTS LEFT *************************************************************
	to retry, use: --limit @playbook.retry

PLAY RECAP *********************************************************************
openshiftdevel             : ok=1    changed=0    unreachable=0    failed=1   



Expected results:
PLAY [try to run a playbook without SELinux bindings] **************************

TASK [setup] *******************************************************************
ok: [openshiftdevel]

TASK [lineinfile] **************************************************************
changed: [openshiftdevel]

PLAY RECAP *********************************************************************
openshiftdevel             : ok=2    changed=1    unreachable=0    failed=0

Comment 1 Stephen Gallagher 2016-09-08 20:13:49 UTC
Patch submitted to comps: https://pagure.io/fedora-comps/pull-request/43

Comment 2 Kevin Fenzi 2016-09-08 20:17:19 UTC
Merged. ;)