-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver_setup.yaml
45 lines (35 loc) · 923 Bytes
/
server_setup.yaml
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
---
- hosts: all
become: true
strategy: free
vars:
ansible_user: root
ansible_port: 22
tasks:
- name: Check server reachability
ansible.builtin.ping:
- name: Apt update
ansible.builtin.apt:
update_cache: true
- ansible.builtin.include_role:
name: common
- ansible.builtin.include_role:
name: firewall
- ansible.builtin.include_role:
name: wireguard
- ansible.builtin.include_role:
name: base
- name: Apply SSH and firewall restarts
meta: flush_handlers
- name: Update SSH connection properties
set_fact:
ansible_user: "{{ base_account_username }}"
ansible_port: "{{ base_ssh_port }}"
- name: Apt upgrade
ansible.builtin.apt:
upgrade: full
- name: Apt autoremove
ansible.builtin.apt:
autoremove: true
- name: Reboot
ansible.builtin.reboot: