Ansible文件复制失败

时间:2014-10-12 21:52:09

标签: module copy ubuntu-14.04 ansible

在最后一次Ansible更新后,复制模块失败并显示以下错误:

failed: [192.168.1.10] => {"failed": true, "md5sum": "cf3f2a865fbea819dadd439586eaee31", "parsed": false}
invalid output was: Traceback (most recent call last):
  File "/tmp/ansible-tmp-1413148553.59-103474418114282/file", line 1675, in <module> main()
  File "/tmp/ansible-tmp-1413148553.59-103474418114282/file", line 204, in main changed = module.set_fs_attributes_if_different(file_args, changed)
  File "/tmp/ansible-tmp-1413148553.59-103474418114282/file", line 898, in set_fs_attributes_if_different file_args['path'], file_args['mode'], changed
  File "/tmp/ansible-tmp-1413148553.59-103474418114282/file", line 875, in set_mode_if_different
raise e
OSError: [Errno 1] Operation not permitted: '/etc/init/avahi-daemon.override'
FATAL: all hosts have already failed -- aborting

我现在尝试复制到/etc/init的任何文件都失败了。我已检查权限,所有权等。文件到其他目录复制正常。我已经成功使用了几个月的配置,现在它失败了。

这是一行失败的样本:

- name: turn off avahi-cups-reload.override
  copy: src=/etc/init/avahi-cups-reload.override dest=/etc/init/avahi-cups-reload.override owner=root group=root mode=0744

有趣的是这条线是成功的:

- name: copy updated /etc/aliases
  copy: src=/etc/aliases dest=/etc/aliases owner=root group=root mode=0644
  notify:
    - run newaliases

我在所有机器和Ansible上运行Ubuntu 14.04 LTS(1.7.2-1ppa~可靠)。

1 个答案:

答案 0 :(得分:0)

您需要将bday置于游戏级别或任务级别。

对于比赛级别

a

对于任务级别

bday