devel branch, commit b35337a629a0d93bf52372d8bf6696d7d3964694: problem with selinux on centos5

The task:

  • name: “instal Vadim Shkolin’s repository”
    action: copy src=vsh.repo
    dest=/etc/yum.repos.d/vsh.repo
    backup=yes force=yes
    owner=root group=root mode=0644 setype=_default

The result:

TASK: [yum_vsh | instal Vadim Shkolin’s repository] ***************************
failed: [cfgtest532] => {“failed”: true, “item”: “”, “parsed”: false}
invalid output was: Traceback (most recent call last):
File “/root/.ansible/tmp/ansible-1381794860.6-101668571529402/copy”, line 1139, in ?
main()
File “/root/.ansible/tmp/ansible-1381794860.6-101668571529402/copy”, line 155, in main
module.atomic_move(src, dest)
File “/root/.ansible/tmp/ansible-1381794860.6-101668571529402/copy”, line 1070, in atomic_move
self.set_context_if_different(dest, context, False)
File “/root/.ansible/tmp/ansible-1381794860.6-101668571529402/copy”, line 498, in set_context_if_different
if context[i] is not None and context[i] != cur_context[i]:
IndexError: list index out of range

failed: [cfgtest564] => {“failed”: true, “item”: “”, “parsed”: false}
invalid output was: Traceback (most recent call last):
File “/root/.ansible/tmp/ansible-1381794860.63-85389446972828/copy”, line 1139, in ?
main()
File “/root/.ansible/tmp/ansible-1381794860.63-85389446972828/copy”, line 155, in main
module.atomic_move(src, dest)
File “/root/.ansible/tmp/ansible-1381794860.63-85389446972828/copy”, line 1070, in atomic_move
self.set_context_if_different(dest, context, False)
File “/root/.ansible/tmp/ansible-1381794860.63-85389446972828/copy”, line 498, in set_context_if_different
if context[i] is not None and context[i] != cur_context[i]:
IndexError: list index out of range

The file was created, but security context was not set. When I play this task again (file /etc/yum.repos.d/vsh.repo is exists on target systems, but has wrong context), the taks is executed without errors and context is set properly. When I remove file from targed systems and comment “setype=_default”, taks is executed without errors, but file has wrong context. When I execute this task on CentOS-6 systems, all work fine.

When I use branch “release1.3.3”, all work fine with both CentOS5 and CentOS6 systems.

Thanks, can you please file this bug report on github?

github.com/ansible/ansible.

Thanks!

This way things will not get lost.