-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
executable file
·112 lines (96 loc) · 2.5 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env ansible-playbook
---
- hosts: all
gather_facts: true
gather_subset: min
become: true
vars_files:
- secrets.yml
vars:
locale: "en_US.UTF-8"
timezone: "America/Chicago"
armhf_arches:
- armv7l
packages_to_install:
- apt-file
- augeas-tools
- bpython3
- exa
- fasd
- fd-find
- fzf
- git
- hdparm
- hexyl
- httpie
- htop
- iftop
- iotop
- ipython3
- jq
- lnav
- lshw
- mlocate
- mosh
- nmap
- pigpio
- python-pigpio
- python-rpi.gpio
- ripgrep
- screen
- ssh-askpass
- tmux
- vim
tasks:
- name: configure wifi
template: src=templates/wpa_supplicant.conf.j2 dest=/etc/wpa_supplicant/wpa_supplicant.conf
notify: reboot
when: false
- name: install packages
apt: pkg={{ packages_to_install }} state=present cache_valid_time=3600
tags: apt
# curl --silent -H "Accept: application/vnd.github.v3+json" \
# "https://api.github.com/repos/sharkdp/bat/releases/latest" \
# | jq '.assets[]? | select(.browser_download_url | endswith("_armhf.deb")) | .browser_download_url'
- name: install bat
apt: deb=https://github.com/sharkdp/bat/releases/download/v0.18.1/bat_0.18.1_armhf.deb cache_valid_time=3600
when: ansible_facts['architecture'] in armhf_arches
tags: apt
- name: link fd
file: path=/usr/local/bin/fd src=/usr/bin/fdfind state=link
- name: apt dist-upgrade
apt: autoclean=yes autoremove=yes cache_valid_time=3600 upgrade=dist
notify: reboot
tags: update, upgrade, apt
- import_tasks: locale.yml
- import_tasks: dotfiles.yml
tags: dotfiles
- name: generate ssh keys
user: name=pi generate_ssh_key=yes ssh_key_type=ed25519
tags: net, ssh
- name: copy update file
copy:
src: aup
dest: /usr/local/bin/
mode: 0755
owner: root
- name: copy helper scripts
copy:
src: "{{ item }}"
dest: /home/pi/bin/
mode: 0750
owner: pi
loop:
- throttled.sh
- name: install vcgencmd bash completion
copy:
src: vcgencmd-completion.bash
dest: /usr/share/bash-completion/completions/vcgencmd
owner: root
mode: 0644
handlers:
- name: reboot
command: shutdown -r now "Ansible updates triggered"
async: 0
poll: 0
ignore_errors: true