-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy_homelab_svc_mgmt.yml
76 lines (61 loc) · 1.63 KB
/
deploy_homelab_svc_mgmt.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
---
- name: Provision host
hosts: sppve
gather_facts: false
vars:
resource_type: vm
vmid: 110
hostname: mgmt
comment: Management
vm_image: /mnt/pve/spsrv-proxmox/template/qcow2/ubuntu-20.04-server-cloudimg-amd64.img
cores: 2
mem: 4096
disk_size: 20
net_ip: 192.168.11.2
net_vlan: 11
net_gw: 192.168.11.1
net_dns: 192.168.11.1
net_domain: "{{ inventory__homelab_domain }}"
vm_other_options: >
--onboot 1
roles:
- { role: pve_manager }
- { role: portainer_api }
- name: Pre-configure host
hosts: mgmt
gather_facts: true
pre_tasks:
- name: Wait for cloud-init to finish
ansible.builtin.wait_for:
path: /var/lib/cloud/instance/boot-finished
- name: Set timezone
community.general.timezone:
name: Europe/Moscow
become: true
- name: Check if reboot required
ansible.builtin.stat:
path: /var/run/reboot-required
register: reboot_required
tags: reboot
- name: Reboot
ansible.builtin.reboot:
when: reboot_required.stat.exists
become: true
tags: reboot
roles:
- { role: common/sytemd_resolved }
# - name: Apply common roles
# hosts: mgmt
# gather_facts: false
# roles:
# - { role: common/packages, become: true }
# - { role: spirkaa.zsh_prezto }
# - { role: spirkaa.nano }
# - { role: common/motd, become: true }
# - { role: common/sshd, become: true }
# - { role: common/docker, become: true }
- name: Apply host-specific roles
hosts: mgmt
gather_facts: false
roles:
- { role: homelab_svc/mgmt, become: true, tags: [mgmt, svc] }