N
N
Nikolai Savelyev2017-08-01 13:39:28
linux
Nikolai Savelyev, 2017-08-01 13:39:28

How does copying files work with ansible?

I am writing a playbook of the initial system setup. To ensure that all users have the same settings, I copy pre-prepared files to /etc/skel
Here is the code:

- name: copy skel
  copy: src=templates/skel/ dest=/etc/skel/

The documentation says so that with a slash copies the contents, without - the folder itself.
It doesn't copy me. It hangs for 3-4 minutes and then loads the disk so that it is impossible to access the server via ssh.
If you start top in advance, then wa 96-97
Once I did not interrupt Ctrl-C, left it hanging for an hour - it killed the root FS. I mounted it in RO and did not recover after the reboot. Even fsck didn't help. I had to restore the virtual machine from a backup.
What is it? How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Serenko, 2017-08-04
@p1r4te

- name: copy skel
    copy:
        src: templates/skel/
        dest: /etc/skel/
        owner: username
        group: username
        mode: '0755'
    become: yes
    tags: copy_skel

That's how it works for me. If it does not work out, the ansible log to the studio.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question