Answer the question
In order to leave comments, you need to log in
Why does Ansible, when copying folders that contain folders, give the latter “empty” rights?
I have a task like:
- name: Copying common web server configs
tags:
- services_prepare
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
directory_mode: yes
owner: root
group: root
mode: 0644
loop:
- { src: "/root/repo_env/configs/common/exim/", dest: "/etc/exim/" }
- { src: "/root/repo_env/configs/common/httpd/", dest: "/etc/httpd/" }
Answer the question
In order to leave comments, you need to log in
I have not yet figured out why, but the record of the form
mode: 0644does not work as described in the documentation.
Why the hell do you need a loop here? how did you even come up with such a perversion and come up with it? Where did you get such brain inflammation)))
as far as I remember, ansible itself can copy directories through mines,
you just need to specify a slash at the end
without any loops
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question