2022-12-22 19:18:27 +00:00
|
|
|
# vim: ft=yaml.ansible
|
|
|
|
---
|
2022-12-25 18:20:23 +00:00
|
|
|
- name: Set hostname
|
2023-03-22 18:31:21 +00:00
|
|
|
ansible.builtin.hostname:
|
2022-12-25 18:20:23 +00:00
|
|
|
name: "{{ hostname }}"
|
|
|
|
|
|
|
|
- name: Set timezone
|
2023-03-22 18:31:21 +00:00
|
|
|
community.general.timezone:
|
2022-12-25 18:20:23 +00:00
|
|
|
name: "{{ timezone }}"
|
|
|
|
|
2023-05-28 16:46:01 +00:00
|
|
|
- name: Set /etc/resolv.conf symlink
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/resolv.conf
|
|
|
|
src: /run/systemd/resolve/resolv.conf
|
|
|
|
owner: root
|
|
|
|
force: true
|
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: Disable systemd-resolved stub resolver
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: /etc/systemd/resolved.conf
|
|
|
|
regexp: '^#?DNSStubListener='
|
|
|
|
line: 'DNSStubListener=no'
|
|
|
|
state: present
|
|
|
|
notify: Restart systemd-resolved
|
|
|
|
|
2022-12-22 19:18:27 +00:00
|
|
|
- name: Upgrade system packages
|
2023-03-22 18:31:21 +00:00
|
|
|
ansible.builtin.apt:
|
2022-12-22 19:18:27 +00:00
|
|
|
update_cache: true
|
|
|
|
upgrade: full
|
|
|
|
|
|
|
|
- name: Install packages via apt
|
2023-03-22 18:31:21 +00:00
|
|
|
ansible.builtin.apt:
|
2022-12-22 19:18:27 +00:00
|
|
|
name: "{{ pkgs }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
pkgs:
|
|
|
|
- apparmor
|
2022-12-25 18:20:23 +00:00
|
|
|
- curl
|
|
|
|
- git
|
2022-12-22 19:18:27 +00:00
|
|
|
- haveged
|
2022-12-23 15:57:37 +00:00
|
|
|
- needrestart
|
|
|
|
- python3-pip
|
2022-12-22 19:18:27 +00:00
|
|
|
- ufw
|
2022-12-25 18:20:23 +00:00
|
|
|
- unattended-upgrades
|
2022-12-25 22:51:17 +00:00
|
|
|
|
2022-12-25 23:26:01 +00:00
|
|
|
- name: Clone apt-update-push
|
2023-03-22 18:31:21 +00:00
|
|
|
ansible.builtin.git:
|
2023-01-03 21:30:22 +00:00
|
|
|
dest: /home/{{ ansible_user }}/apt-update-push
|
2022-12-25 23:26:01 +00:00
|
|
|
repo: https://github.com/samsapti/apt-update-push.git
|
|
|
|
clone: true
|
|
|
|
update: true
|
|
|
|
single_branch: true
|
|
|
|
depth: 1
|
|
|
|
become: false
|
2022-12-31 14:53:24 +00:00
|
|
|
notify: apt-update-push
|
|
|
|
|
|
|
|
- name: Clone pi-fan-controller
|
2023-03-22 18:31:21 +00:00
|
|
|
ansible.builtin.git:
|
2023-01-03 21:30:22 +00:00
|
|
|
dest: /home/{{ ansible_user }}/pi-fan-controller
|
2022-12-31 14:53:24 +00:00
|
|
|
repo: https://github.com/Howchoo/pi-fan-controller.git
|
|
|
|
clone: true
|
|
|
|
update: false
|
|
|
|
single_branch: true
|
|
|
|
depth: 1
|
|
|
|
become: false
|
|
|
|
notify: pi-fan-controller
|