-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain.yml
255 lines (207 loc) · 9.27 KB
/
main.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
---
# Defaults
# Required/most important vars:
# hostname (FQDN):
# compute_instance_hostname: "FQDN"
# distribution (values: debian, ubuntu, centos):
# compute_instance_distribution: "debian"
# name of the template-VM to clone from (cloud image)
# compute_instance_cloudinit_image: "template-cloudinit-deb12-latest"
# memory (max.) for VM (in MB), example with 2G:
# compute_instance_memory_max: 2048
# number of CPU cores (example: 2):
# compute_instance_cores: 2
# Specify emulated CPU type (if none is selected proxmox will choose "kvm64" by itself, other common choices are "host" or plattforms like "SandyBridge-IBRS" to allow live-migration with different Host-CPUs)
# for more information see: https://pve.proxmox.com/pve-docs/chapter-qm.html#qm_cpu
# compute_instance_cpu: kvm64
# disk size in GB (example: 20G):
# compute_instance_disksize: 20
# name of target storage (proxmox usually has local" or "local-zfs)
# compute_instance_storage: "local-zfs"
# network/IP for new instance, valid choices:
# - name of prefixe network FIXME (ipam will choose next free IP)
# - a specific IP with CIDR (like 192.168.178.33/24)
# - "no" -> no v4 (or v6) networking
#
# Examples:
# compute_instance_ip_v4: "server_network_v4"
# OR:
# compute_instance_ip_v4: "192.168.178.33/24"
# deactivate IPv6:
# compute_instance_ip_v6: "no"
# compute_instance_vlan -> specifiy VLAN (if needed), valid choices:
# - variable is not defined -> no vlans used
# - number (integer) i.e. vlan 100 would be: "compute_instance_vlan: 100")
# or ask netbox for the vlan of the prefix (set to true, default is false. needs "compute_instance_ipam_provider: netbox" to be used):
netbox_query_vlan_from_prefix: true
# default bridge:
compute_instance_bridge: vmbr0
# valid choices: proxmox
compute_instance_virtualization_provider: proxmox
# valid choices: netbox
compute_instance_ipam_provider: netbox
# valid choices: hetzner, inwx
compute_instance_dns_provider: hetzner
# install required pip modules?
compute_instance_install_requirements: true
compute_instance_install_pip_enable: false
compute_instance_install_pip_role: "geerlingguy.pip"
# DNS
# TTL 4h -> 14400
compute_instance_dns_ttl: 14400
# print additional debug output:
compute_instance_debug_mode_enable: false
# netbox ====
netbox_fail_if_ip_entry_exists: true
netbox_validate_certs: true
netbox_prefix_name_query_method: "netbox_description"
# how to find the gateway IP, methods available:
# - netbox_tag: in order to query for the defined gateway in each prefix please tag only one IP-address per prefix with this tag
# - custom_field: use custom field with name defined in var "netbox_gateway_query_term"
# - last_ip: use last useable IP in the prefix
# - first_ip: use first useable IP in the prefix
netbox_gateway_query_method: "netbox_tag"
netbox_gateway_query_term: "gateway"
# specify bridge (for proxmox), choices:
# - "variable" -> use "compute_instance_bridge"
# - "custom_field" -> query netbox with custom-field defined from "netbox_bridge_query_term" (Content type of custom field needs to be "IPAM > Prefix" with Type "Text")
netbox_bridge_query_method: "variable"
netbox_bridge_query_term: "prox_bridge"
# Proxmox and clout-init ====
# where to create the instance:
proxmox_create_node: localhost
# set if node name is not equal to ansible ssh-connection (usually a FQDN is used here):
proxmox_create_node_ansible: localhost
proxmox_cluster_name: "proxcluster1"
dns_entry_create_enable: false
# currently supported: inwx, hetzner
dns_entry_create_provider: ""
# compute_instance_disksize: values -> disk size total (example: "20G") or grow by GB: (example: "+18G")
proxmox_vm_scsihw: "virtio-scsi-pci"
proxmox_vm_bootdisk: "virtio0"
proxmox_vm_diskdevice: "virtio0"
proxmox_vm_vga: qxl
proxmox_vm_onboot: true
proxmox_vm_ostype: l26
proxmox_vm_distribution: debian
proxmox_vm_agent: true
proxmox_vm_autostart: true
# set to true if you want a new template to be generated:
cloudinit_image_create_enable: false
cloudinit_os_default_user: debian
# FIXME generate random values?
# cloudinit_os_default_rootpassword: -> vault
# cloudinit_os_default_userpassword: -> vault
# baserole_root_password_hash_sha512: -> vault
# baserole_user_password_hash_sha512: -> vault
cloudinit_disable_root: false
cloudinit_package_upgrade: true
cloudinit_resize_rootfs: true
cloudinit_move_network_config_to_main_file: true
# set to false if cloud-init should manage the system after first configuration
cloudinit_disabled: true
proxmox_resize: true
proxmox_start: true
proxmox_update: true
proxmox_task_timeout: 120
# upgrades packages (will take time if the cloudinit_image is outdated)
proxmox_upgrade_packages_on_create: true
# move config from /etc/network/interfaces.d/50-cloud-init to /etc/network/interfaces (or /etc/netplan/50-cloud-init.yaml or ):
cloudinit_move_network_to_main_file: true
compute_instance_cloudinit_image: "template-cloudinit-deb12-latest"
proxmox_snippet_dir: /var/lib/vz/snippets
proxmox_snippet_storage: local
# storage 'proxmox_cephfs' does not support content-type 'images':
# proxmox_snippet_dir: /mnt/pve/proxmox_cephfs/snippets
# proxmox_snippet_storage: proxmox_cephfs
# proxmox_snippet_user_data_file: user-data.yml
proxmox_snippet_user_data_file: user-data-{{ compute_instance_hostname }}.yml
proxmox_snippet_user_data_dest: "{{ proxmox_snippet_dir }}/{{ proxmox_snippet_user_data_file }}"
proxmox_snippet_user_data_template: "templates/proxmox_cloudinit_user_data.j2"
# enable DNS-record creation:
compute_instance_dns_create_records_enable: false
# set dns server in custom user-config !! will not work on proxmox since DNS searchdomain and DNS server defaults to host settings (of node running the vm)!
cloudinit_dns_set_servers: true
# order: google-dns, cloudflare, quad9 (change to your needs!), these setting will be used to set cloudinit_dns_servers depending on network_mode
cloudinit_dns_servers_v4only:
- 8.8.4.4
- 1.1.1.1
- 9.9.9.9
cloudinit_dns_servers_v6only:
- 2001:4860:4860::8888
- 2606:4700:4700::1111
- 2620:fe::fe
cloudinit_dns_servers_dualstack:
- 8.8.4.4
- 1.1.1.1
- 2620:fe::fe
cloudinit_os_ssh_pubkeys: []
# example:
#cloudinit_os_ssh_pubkeys:
# - ssh-rsa AAAAB... pubkey1
# - ssh-ed25519 AAAA... pubkey2
# default is false:
cloudinit_os_ssh_root_pwauth: true
cloudinit_os_timezone: "Europe/Berlin"
# Vars for generating the template
cloudinit_download_folder: "/tmp/cloudinit"
cloudinit_download_filename: "cloudinit-image.qcow2"
cloudinit_download_image: true
# overwrite file if already existing:
cloudinit_download_overwrite: true
# remove downloaded file:
cloudinit_remove_downloaded_image: true
# remove existing image (if present):
compute_instance_cloudinit_image_destroy_old: false
# the following comment is added on the template (visible in GUI):
cloudinit_template_description: "updated on: {{ ansible_date_time.iso8601 }}"
# enable custom grub cmdline
cloudinit_grub_cmdline_enabled: false
# example for eth0-interface (" needs to be escaped with \ for grub):
# cloudinit_grub_cmdline_string: '\"net.ifnames=0 biosdevname=0\"'
cloudinit_grub_cmdline_file: "/etc/default/grub"
cloudinit_images:
centos7_amd64:
url: "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2"
hash_algorithm: sha256
hash_checksum_file: "https://cloud.centos.org/centos/7/images/sha256sum.txt"
centos8_stream_amd64:
url: "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-latest.x86_64.qcow2"
hash_algorithm: "none"
hash_checksum_file: ""
centos9_stream_amd64:
# image hangs at boot, dunno why
url: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2"
hash_algorithm: "none"
hash_checksum_file: ""
debian10_amd64:
url: "https://cdimage.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2"
hash_algorithm: sha512
hash_checksum_file: "https://cdimage.debian.org/images/cloud/buster/latest/SHA512SUMS"
debian11_amd64:
url: "https://cdimage.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2"
hash_algorithm: sha512
hash_checksum_file: "https://cdimage.debian.org/images/cloud/bullseye/latest/SHA512SUMS"
debian12_amd64:
url: "https://cdimage.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2"
hash_algorithm: sha512
hash_checksum_file: "https://cdimage.debian.org/images/cloud/bookworm/latest/SHA512SUMS"
ubuntu18_04_amd64:
url: "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"
hash_algorithm: sha256
hash_checksum_file: "https://cloud-images.ubuntu.com/bionic/current/SHA256SUMS"
ubuntu20_04_amd64:
url: "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img"
hash_algorithm: sha256
hash_checksum_file: "https://cloud-images.ubuntu.com/focal/current/SHA256SUMS"
ubuntu22_04_amd64:
url: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
hash_algorithm: sha256
hash_checksum_file: "https://cloud-images.ubuntu.com/jammy/current/SHA256SUMS"
ubuntu24_04_amd64:
url: "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img"
hash_algorithm: sha256
hash_checksum_file: "https://cloud-images.ubuntu.com/noble/current/SHA256SUMS"
# empty internal vars):
compute_instance_ip_v4_is: ""
compute_instance_ip_v6_is: ""