Closed VictorMorenoJimenez closed 4 years ago
When running a simple copy from src to dest, Permisson Error.
fatal: [tfg2.intelligenia.com]: FAILED! => {"changed": false, "msg": "failed to copy: /etc/letsencrypt/live/tfg2.intelligenia.com/fullchain.pem to /etc/pve/local/pve-ssl.pem", "traceback": "Traceback (most recent call last):\n File \"/tmp/ansible_copy_payload_4gcjahrs/ansible_copy_payload.zip/ansible/modules/files/copy.py\", line 659, in main\n File \"/usr/lib/python3.7/shutil.py\", line 207, in copystat\n lookup(\"chmod\")(dst, mode, follow_symlinks=follow)\nPermissionError: [Errno 1] Operation not permitted: b'/etc/pve/local/tmp_bi4rw8e'\n"}
Executed manual no errors
Code
- name: Copy fullchain.pem to proxmox folder copy: src: /etc/letsencrypt/archive/{{ servername }}/fullchain1.pem dest: /etc/pve/local/pve-ssl.pem local_follow: False remote_src: yes
Workaround:
Execute copy command with shell module.
- name: Copy fullchain.pem to proxmox folder shell: | cp /etc/letsencrypt/archive/"{{ servername }}"/fullchain1.pem /etc/pve/local/pve-ssl.pem cp /etc/letsencrypt/archive/"{{ servername }}"/privkey1.pem /etc/pve/local/pve-ssl.key cp /etc/letsencrypt/archive/"{{ servername }}"/chain1.pem /etc/pve/pve-root-ca.pem
Maybe can improve copy using Ansible module.
This is working properly, no need to use copy module.
When running a simple copy from src to dest, Permisson Error.
fatal: [tfg2.intelligenia.com]: FAILED! => {"changed": false, "msg": "failed to copy: /etc/letsencrypt/live/tfg2.intelligenia.com/fullchain.pem to /etc/pve/local/pve-ssl.pem", "traceback": "Traceback (most recent call last):\n File \"/tmp/ansible_copy_payload_4gcjahrs/ansible_copy_payload.zip/ansible/modules/files/copy.py\", line 659, in main\n File \"/usr/lib/python3.7/shutil.py\", line 207, in copystat\n lookup(\"chmod\")(dst, mode, follow_symlinks=follow)\nPermissionError: [Errno 1] Operation not permitted: b'/etc/pve/local/tmp_bi4rw8e'\n"}
Executed manual no errors
Code
Workaround:
Execute copy command with shell module.
Maybe can improve copy using Ansible module.