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.