Skip to content

Commit fc268bf

Browse files
authored
Merge pull request #50 from Diesel-Net/development
Promotion
2 parents 2e96c40 + c652b22 commit fc268bf

14 files changed

Lines changed: 192 additions & 31 deletions

File tree

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
- hosts: localhost
2-
strategy: free
1+
- import_playbook: power_on.yaml
2+
3+
- hosts: manager:worker
4+
strategy: linear
5+
gather_facts: no
36
tasks:
7+
8+
- name: wait for connections
9+
wait_for_connection:
10+
411
- include_role:
512
name: ubuntu
613
tasks_from: scan_hosts
714

815

9-
- hosts: all
16+
- hosts: manager:worker
1017
strategy: free
1118
tasks:
19+
1220
- include_role:
1321
name: ubuntu
1422
tasks_from: setup_user
@@ -18,7 +26,7 @@
1826
ansible_sudo_pass: "{{ ansible_ssh_pass }}"
1927

2028

21-
- hosts: all
29+
- hosts: manager:worker
2230
strategy: free
2331
roles:
2432
- ubuntu
@@ -42,3 +50,4 @@
4250
name: docker
4351
tasks_from: install_nvidia_toolkit
4452

53+
- import_playbook: power_off.yaml

.ansible/clean.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
- hosts: all
1+
- import_playbook: power_on.yaml
2+
3+
- hosts: manager:worker
24
strategy: free
5+
gather_facts: no
36
tasks:
47

8+
- name: wait for connections
9+
wait_for_connection:
10+
511
- include_role:
612
name: docker
713
tasks_from: system_prune
814
vars:
9-
options: --all
15+
options: --volumes
16+
17+
- import_playbook: power_off.yaml

.ansible/files/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
dnspython==2.1.0
1+
dnspython
2+
proxmoxer

.ansible/group_vars/all/main.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
proxmox_realm: pve
2+
proxmox_user: '{{ lookup("env", "PROXMOX_USER") }}@{{ proxmox_realm }}'
3+
proxmox_password: '{{ lookup("env", "PROXMOX_PASS") }}'
4+
proxmox_api_host: pve.diesel.net
5+
proxmox_node: pve

.ansible/inventory/development/hosts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
all:
22
children:
33

4+
45
manager:
56
hosts:
7+
68
dev.diesel.net:
9+
10+
automation-station.diesel.net:
11+
auto_reboots: no
12+
13+
14+
offline:
15+
hosts:
16+
17+
automation-station.diesel.net:
718

819
vars:
920
ansible_user: automation
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
all:
22
children:
33

4+
45
manager:
56
hosts:
7+
68
prod.diesel.net:
7-
automation-station.diesel.net:
89

9-
drone:
10-
hosts:
1110
drone.diesel.net:
1211
auto_reboots: no
1312

14-
tools:
15-
hosts:
1613
tools.diesel.net:
1714

18-
games:
19-
hosts:
2015
games.diesel.net:
2116

22-
es:
23-
hosts:
2417
es.diesel.net:
2518

19+
gpu.diesel.net:
20+
21+
2622
nvidia:
2723
hosts:
24+
2825
gpu.diesel.net:
2926

27+
28+
offline:
29+
hosts:
30+
31+
games.diesel.net
32+
3033
vars:
3134
ansible_user: automation
3235
ansible_python_interpreter: /usr/bin/python3

.ansible/inventory/stable/hosts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
all:
22
children:
33

4+
45
manager:
56
hosts:
7+
68
test.diesel.net:
79

810
vars:

.ansible/power_off.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- hosts: offline
2+
gather_facts: no
3+
strategy: free
4+
tasks:
5+
6+
- name: power off VMs
7+
proxmox_kvm:
8+
name: '{{ inventory_hostname_short }}'
9+
api_user: '{{ proxmox_user }}'
10+
api_password: '{{ proxmox_password }}'
11+
api_host: '{{ proxmox_api_host }}'
12+
node: '{{ proxmox_node }}'
13+
state: stopped
14+
delegate_to: localhost

.ansible/power_on.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- hosts: offline
2+
gather_facts: no
3+
strategy: free
4+
tasks:
5+
6+
- name: power on VMs
7+
proxmox_kvm:
8+
name: '{{ inventory_hostname_short }}'
9+
api_user: '{{ proxmox_user }}'
10+
api_password: '{{ proxmox_password }}'
11+
api_host: '{{ proxmox_api_host }}'
12+
node: '{{ proxmox_node }}'
13+
state: started
14+
delegate_to: localhost
15+

0 commit comments

Comments
 (0)