-
Notifications
You must be signed in to change notification settings - Fork 0
/
raspberrypi.yml
69 lines (60 loc) · 2.2 KB
/
raspberrypi.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
---
- hosts: rpi
become: yes
gather_facts: no
# hashi-vault
vars:
vault: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=kv-v2/data/secret/ansible auth_method=approle') }}"
tasks:
- block:
- name: Authenticate via signed SSH certificate
import_role:
name: vault-ssh-ca
tasks_from: ssh-client
when: ansible_ssh_private_key_file is undefined # pass --private-key and --limit for new hosts once
vars:
vault_addr: "{{ lookup('env','VAULT_ADDR') }}"
vault_role_id: "{{ lookup('env','ANSIBLE_HASHI_VAULT_ROLE_ID') }}"
vault_secret_id: "{{ lookup('env','ANSIBLE_HASHI_VAULT_SECRET_ID') }}"
- name: Gather facts
setup:
- include_role:
name: vault-ssh-ca
vars:
vault_addr: "{{ lookup('env','VAULT_ADDR') }}"
- include_role:
name: jnv.unattended-upgrades
vars:
unattended_origins_patterns:
- 'origin=Raspbian,codename=${distro_codename},label=Raspbian'
unattended_mail: "{{ vault._unattended_mail }}"
unattended_mail_only_on_error: true
unattended_automatic_reboot: true
unattended_automatic_reboot_time: '03:00'
unattended_update_days: {"Fri"}
- include_role:
name: oefenweb.postfix
vars:
postfix_aliases:
- user: rpi
alias: "{{ vault._alias }}"
postfix_relayhost: "{{ vault._postfix_relayhost }}"
postfix_relaytls: true
postfix_smtp_tls_cafile: /etc/ssl/certs/ca-certificates.crt
postfix_sasl_user: "{{ vault._postfix_sasl_user }}"
postfix_sasl_password: "{{ vault._postfix_sasl_password }}"
- include_role:
name: pihole-ufw
when: inventory_hostname == 'pihole'
rescue:
- include_role:
name: vault-ssh-ca
tasks_from: cleanup
run_once: true
when: tempdir_path is defined
always:
- include_role:
name: vault-ssh-ca
tasks_from: cleanup
run_once: true
when: tempdir_path is defined