Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File permissions unset or incorrect

Tags:

ansible

I am using ansible copy module to copy a file. The linter tells me "File permissions unset or incorrect" and I don't understand the problem.

Here is the ansible task

- name: Ensure some.txt is there
  copy:
    src: some.txt
    dest: "{{ some_path }}/some.txt"
    force: false
    mode: '644'

Where some.txt is a file that exists in the ansible/files directory. I have also tried with mode: 0644 but no luck.

My ansible version:

$ ansible-lint --version
ansible-lint 5.0.7 using ansible 2.10.8

Restarting the editor fixed it, but that's not really an answer. Any ideas?

like image 301
Human Avatar asked Oct 21 '25 23:10

Human


1 Answers

You just need to specify mode: 0644 in your playbook and it will be all good.

like image 155
Naqi Avatar answered Oct 26 '25 02:10

Naqi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!