-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsample-playbook.yml
58 lines (52 loc) · 1.58 KB
/
sample-playbook.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
---
- hosts: all
connection: local
gather_facts: False
sudo: False
vars_prompt:
- name: bigv_user
prompt: "Enter bigv user"
private: False
- name: bigv_password
prompt: "Enter bigv password"
private: True
- name: bigv_yubikey
prompt: "Press the yubikey"
private: False
tasks:
- name: make sure the vm exists
local_action: bigv-vm
login_username={{ bigv_user }}
login_password={{ bigv_password }}
login_yubikey={{ bigv_yubikey }}
vm_name={{ inventory_hostname }}
vm_distribution=wheezy
vm_root_password={{ vm_password }}
vm_rdns={{ inventory_hostname_short }}.my-brilliant-site.com
group_create=yes
state=running
- name: check it is running ssh
local_action: "wait_for port=22 state=started timeout=120 host={{ inventory_hostname }} search_regex=OpenSSH"
- name: create the archive disc
local_action: bigv-disc
login_username={{ bigv_user }}
login_password={{ bigv_password }}
login_yubikey={{ bigv_yubikey }}
vm_name={{ inventory_hostname }}
disc_label=backups
disc_grade=archive
disc_size=500
- name: stop the machine
local_action: bigv-vm
login_username={{ bigv_user }}
login_password={{ bigv_password }}
login_yubikey={{ bigv_yubikey }}
vm_name={{ inventory_hostname }}
state=stopped
- name: delete the machine
local_action: bigv-vm
login_username={{ bigv_user }}
login_password={{ bigv_password }}
login_yubikey={{ bigv_yubikey }}
vm_name={{ inventory_hostname }}
state=absent