---
- hosts: testhost
become: yes
tasks:
- name: change user profile
copy: src=/tmp/profile dest=/home/test/.bash_profile force=no owner=test group=test
- name: update bashrc
copy: src=/tmp/bashrc dest=/home/test/.bashrc owner=test group=test force=no
- name: add umask to the file
lineinfile: dest=/home/test/.bashrc create=no line="umask 022" create=no
Похоже, это copy
что создает файл. Эта строка не изменит уже существующий файл (потому что force=no
), но будет, когда этого не произойдет.
Затем lineinfile
убедится, что файл содержит umask 022
.