]> git.phdru.name Git - ansible.git/blob - playbooks/update-root.yml
Feat(update-root): Sync `ssh/known_hosts`
[ansible.git] / playbooks / 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       ansible.posix.synchronize:
8         src: "~phd/{{ item }}"
9         dest: ~root
10         archive: no  # avoid setting owner/group
11         recursive: yes
12         links: yes
13         times: yes
14       delegate_to: "{{ inventory_hostname }}"
15       loop: ['.vim', 'bin', 'lib']
16
17     - name: "Update ~root - sync files from ~phd"
18       copy:
19         src: "~phd/{{ item }}"
20         remote_src: yes
21         dest: ~root
22         owner: root
23         group: root
24         mode: "0600"
25       loop: ['.bashrc', 'admin/home/root/.profile',
26              '.bash_logout', '.inputrc', '.less', '.lesskey',
27              '.screenrc', '.shellrc', '.tmux.conf', '.vimrc',
28             ]
29
30     - name: "Update ~root/.ssh/known_hosts"
31       copy:
32         src: ~phd/.ssh/known_hosts
33         remote_src: yes
34         dest: ~root/.ssh/known_hosts
35         owner: root
36         group: root
37         mode: "0600"
38
39     - name: "Create ~root/admin/prog/"
40       file:
41         path: ~root/admin/prog
42         state: directory
43         owner: root
44         group: root
45         mode: "0600"
46
47     - name: "Update ~root/admin/prog/bash_prompt"
48       copy:
49         src: ~phd/admin/prog/bash_prompt
50         remote_src: yes
51         dest: ~root/admin/prog/bash_prompt
52         owner: root
53         group: root
54         mode: "0600"
55
56     - name: "Update root mc - overwrite files from ~phd/admin"
57       become: true
58       copy:
59         src: "~phd/admin/home/root/.mc/{{ item }}"
60         remote_src: yes
61         dest: ~root/.mc
62         owner: root
63         group: root
64         mode: "0600"
65         force: no
66       loop: ['hotlist', 'ini', 'panels.ini']