Impossible: / etc is not writable

I am trying to copy a file to / etc. But I get "msg: Destination / etc not writeable" when I run the playbook. Here is my task for the Playbook. I really appreciate your help.

tasks:

- name: copy rsyslog sudo: yes copy: src: /home/nandakumar.nachimuth/playbooks/rhn_check/rtest.conf dest: /etc/rtest.conf owner: root group: root mode: 0755 ignore_errors: yes 

Error

msg: Destination /etc not writable

Note. I provided for the transfer of ssh and sudo when starting the Playbook.

+11
source share
4 answers

The user must have root privileges.

I think this should help. My problem was that user1 had root privileges and I could not write an error. Just putting "become: yes", I got rid of this error.

 - hosts: analytics user: user1 become: yes become_user: root gather_facts: yes roles: - name: xxxxx 
+1
source

You need to specify sudo after the user with the hosts example:

 -hosts: abc user: xyz sudo: yes 

This will work for you.

0
source

Instead of using sudo with your tasks, try adding become: yes to your game book

.example

 - hosts: all become: yes 

Also make sure that you really enter the sudo password instead of the user password.

0
source

You need to reconfigure sshd so your user can switch to using sudo without a password. To do this, you need to run sudo visudo , and then change the line with your user to look like this:

 your_username ALL=(ALL) NOPASSWD: ALL 

And that will do the trick.

-1
source

Source: https://habr.com/ru/post/1246921/


All Articles