]> git.phdru.name Git - ansible.git/blob - playbooks/debian/update-root.yml
Feat: Use `changed_when` to avoid reporting changes
[ansible.git] / playbooks / debian / update-root.yml
1 - name: "Update ~root from ~phd"
2   hosts: "{{ hosts | default('all') }}"
3   become: yes
4   gather_facts: false
5   tasks:
6     - name: "Update ~root - sync directories from ~phd"
7       command: "rsync -rlt --info=name ~phd/{{ item }} ~root"
8       register: rsync
9       changed_when: rsync.stdout != ''
10       loop: ['.vim', 'bin', 'lib']
11
12     - name: "Update ~root - sync files from ~phd"
13       copy:
14         src: "~phd/{{ item }}"
15         remote_src: yes
16         dest: ~root
17         owner: root
18         group: root
19         mode: "0600"
20         force: no
21       loop: ['.bashrc', 'admin/home/root/.profile',
22              '.bash_logout', '.inputrc', '.less', '.lesskey',
23              '.screenrc', '.shellrc', '.tmux.conf', '.vimrc',
24             ]
25
26     - name: "Update root mc - overwrite files from ~phd/admin"
27       become: true
28       copy:
29         src: "~phd/admin/home/root/.mc/{{ item }}"
30         remote_src: yes
31         dest: ~root/.mc
32         owner: root
33         group: root
34         mode: "0600"
35         force: no
36       loop: ['hotlist', 'ini', 'panels.ini']
37