]# ls -ld /app_mnt/app1/conf
drwxrw-r-x. 4 app1 app1 4096 Feb 26 16:41 /app_mnt/app1/conf
---
- hosts: all
gather_facts: False
become: True
become_method: sudo
become_user: app1
roles:
- install_app1
###install_app1
- name: create app1.yml from template
template:
src: app1.yml.j2
dest: "/app_mnt/app1/conf/app1.yml"
owner: "app1"
group: "app1"
mode: 0777
The playbook errors out as below
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
File "/tmp/ansible_copy_payload_AhBaI3/__main__.py", line 417, in main
module.set_mode_if_different(src, mode, False)
File "/tmp/ansible_copy_payload_AhBaI3/ansible_copy_payload.zip/ansible/module_utils/basic.py", line 1314, in set_mode_if_different
os.chmod(b_path, mode)
fatal: [fldpfs02]: FAILED! => {
"changed": false,
"checksum": "e57a94521dd0906e00b662c938b04395a48d362e",
"diff": [],
"invocation": {
"module_args": {
"_original_basename": "app1.yml.j2",
"attributes": null,
"backup": false,
"checksum": "e57a94521dd0906e00b662c938b04395a48d362e",
"content": null,
"delimiter": null,
"dest": "/app_mnt/app1/conf/app1.yml",
"directory_mode": null,
"follow": false,
"force": true,
"group": "app1",
"local_follow": null,
"mode": 511,
"owner": "app1",
"regexp": null,
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "/var/tmp/ansible-tmp-1551239543.64-112658699336592/source",
"unsafe_writes": null,
}
},
"msg": "failed to copy: /var/tmp/ansible-tmp-1551239543.64-112658699336592/source to /app_mnt/app1/conf/app1.yml",
"traceback": "Traceback (most recent call last):\n File \"/tmp/ansible_copy_payload_AhBaI3/__main__.py\", line 417, in main\n module.set_mode_if_different(src, mode, False)\n File \"/tmp/ansible_copy_payload_AhBaI3/ansible_copy_payload.zip/ansible/module_utils/basic.py\", line 1314, in set_mode_if_different\n os.chmod(b_path, mode)\nOSError: [Errno 1] Operation not permitted: '/var/tmp/ansible-tmp-1551239543.64-112658699336592/source'\n"