Compare commits
11 Commits
ebf86b1752
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c4327b2d2 | |||
| 6bfb387008 | |||
| 36399b4d02 | |||
| fcf522c608 | |||
| 246d7aa18d | |||
| a5d3a387ca | |||
| a65387e536 | |||
| fe9c8803e1 | |||
| 45ad9f05ae | |||
| d523589423 | |||
| 9753a3db58 |
@@ -6,3 +6,4 @@ private_key_file=~/.ssh/ansible
|
|||||||
fact_caching = jsonfile
|
fact_caching = jsonfile
|
||||||
fact_caching_connection = facts/
|
fact_caching_connection = facts/
|
||||||
host_key_checking = False
|
host_key_checking = False
|
||||||
|
roles_path:~/dev/ansible/roles/
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
---
|
---
|
||||||
- collections:
|
collections:
|
||||||
- community.general.proxmox
|
# Install a collection from Ansible Galaxy.
|
||||||
|
- name: community.general
|
||||||
|
source: https://galaxy.ansible.com
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
vm_memory: "2048"
|
vm_memory: "2048"
|
||||||
vm_cores: "2"
|
vm_cores: "2"
|
||||||
resize_root_disk_size: "+20G"
|
resize_root_disk_size: "15G"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
[vms]
|
[vms]
|
||||||
semaphore vm_ip_address="ip=10.11.12.250/24,gw=10.11.12.254"
|
fersenweg-shop vm_ip_address="ip=10.11.12.248/24,gw=10.11.12.254" resize_root_disk_size="30G"
|
||||||
|
|
||||||
## defaults:
|
## defaults:
|
||||||
#vm_memory="2048"
|
#vm_memory="2048"
|
||||||
#vm_cores="2"
|
#vm_cores="2"
|
||||||
#resize_root_disk_size="+20G"
|
#resize_root_disk_size="20G"
|
||||||
|
|||||||
28
main.yml
28
main.yml
@@ -1,9 +1,30 @@
|
|||||||
---
|
---
|
||||||
|
### Setup needs to be done if task is run from ansible-semaphore docker container
|
||||||
|
# FIXME NOT WORKING ON Semaphore in docker yet
|
||||||
|
# - name: Install required Pip modules
|
||||||
|
# hosts: localhost
|
||||||
|
# tasks:
|
||||||
|
# - name: Install python-setup tools
|
||||||
|
# remote_user: semaphore
|
||||||
|
# package:
|
||||||
|
# name:
|
||||||
|
# - python3-setuptools
|
||||||
|
# state: latest
|
||||||
|
|
||||||
|
# - name: Install proxmoxer and requests modules
|
||||||
|
# remote_user: semaphore
|
||||||
|
# pip:
|
||||||
|
# name:
|
||||||
|
# - proxmoxer
|
||||||
|
# - requests
|
||||||
|
# state: present
|
||||||
|
|
||||||
- name: Create VM from template, update the ip and hardware, resize the disk,
|
- name: Create VM from template, update the ip and hardware, resize the disk,
|
||||||
hosts: all
|
hosts: all
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars_files:
|
vars_files:
|
||||||
- vars/proxmox.yml
|
- vars/proxmox.yml
|
||||||
|
- defaults/vm_sizing.yml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create VM from template
|
- name: Create VM from template
|
||||||
@@ -20,6 +41,12 @@
|
|||||||
register: vm_created
|
register: vm_created
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
|
- name: Wait 10s for VM to be fully deployed
|
||||||
|
ansible.builtin.wait_for:
|
||||||
|
timeout: 10
|
||||||
|
delegate_to: localhost
|
||||||
|
when: vm_created.changed
|
||||||
|
|
||||||
- name: Update VM configuration
|
- name: Update VM configuration
|
||||||
community.general.proxmox_kvm:
|
community.general.proxmox_kvm:
|
||||||
api_host: "{{ pve_host }}"
|
api_host: "{{ pve_host }}"
|
||||||
@@ -60,6 +87,7 @@
|
|||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
timeout: 180
|
timeout: 180
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
when: vm_created.changed
|
||||||
|
|
||||||
- name: Extract VM IP with regex
|
- name: Extract VM IP with regex
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
- collections:
|
|
||||||
- community.general.proxmox
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
64663830333734373030373566623961376465386165626232656232393238646663343564303335
|
31663663396665623963336664663531356538343866383537343032396633633634353133323039
|
||||||
6235373166393464343831623735393834366130343836380a623463346161623430666235363630
|
6363643061353636656234326664313039326534366532310a663262313836626534393037336165
|
||||||
33373866306231653035346265666566373034326230663236396432343234343066363566623634
|
61313833343865353063343734343637333066643331323833343231356466663334646231373234
|
||||||
3034383036343030370a643539633563353433356565356237323962626238386163626437353831
|
3231313266373861620a663238343366396162356562356430653862636333653638393434326233
|
||||||
30613130353766653961313337383739616364653234666631626565353730663832616531656565
|
39653231316332356332343364353633663965666466393231623466373430633836636635623636
|
||||||
35316134613564343734353337363936633062656131633032353439643230633635316463316233
|
37373539303864323363636364366166376364616537626434373266663433373136346331616261
|
||||||
30336438663432376237363864356266653266626431613862656665373636343465353165626365
|
65633132323736613934333033613862616533613433373430613334326236643062653330636135
|
||||||
38326465306561313435343632393333653434346634396363636162353965643938383636643766
|
64343437336362616264316239386537663235363962333431343864373032363633386535613130
|
||||||
36653561316463636131353135323931383461623932353865333431623731663663303736343632
|
34353931356564343535353531303632306330336563333239323233656335333531656661663864
|
||||||
62386365393432623965373638396331343132313163333838336264353431313661653432353162
|
64643732376532363265376662326433336364616261656162623464383231353765626666623661
|
||||||
626231633462656339396238663634626337
|
323133346237306461373135613564323465
|
||||||
|
|||||||
Reference in New Issue
Block a user