-
Notifications
You must be signed in to change notification settings - Fork 2
/
maintenance.yml
68 lines (64 loc) · 2.09 KB
/
maintenance.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
---
# Check out the branch first as that tells us what snapshot version is being updated
# This is necessary to set baseline_branch
- name: Checkout branches from GitHub
hosts: performance-candlepin-vm
roles:
- candlepin-checkout
vars:
ansible_user: jenkins
tags:
- checkout
- name: Shutdown all vms on hypervisors and reset performance vms
hosts: performance-hypervisors
roles:
- hypervisor
vars:
ansible_user: root
baseline_branch: "{{hostvars['performance-candlepin-vm']['baseline_branch']}}"
tasks:
- name: sleep for ddns to kick in
pause:
minutes: 2
tags:
- setupvms
- name: Setup mysql vm
hosts: performance-mysql-vm
roles:
- mysql-user
vars:
ansible_user: root
tags:
- runtest
# Deploy Candlepin & update the database but do not run the tests
- name: Deploy candlepin and run performance test
hosts: performance-candlepin-vm
environment:
JAVA_HOME: /usr/lib/jvm/java-1.8.0/
roles:
- { role: candlepin-user, deploy_candlepin: true, provision_db: true, run_test: false }
vars:
ansible_user: jenkins
baseline_branch: "{{hostvars['performance-candlepin-vm']['baseline_branch']}}"
# Update the snapshot of the database
- hosts: performance-database-hypervisor
vars:
ansible_user: root
baseline_branch: "{{hostvars['performance-candlepin-vm']['baseline_branch']}}"
tasks:
- name: shutdown performance vms
virt:
name: "{{perf_vm_domain}}"
command: shutdown
register: result
failed_when:
- "result | failed and 'domain is not running' not in result.msg"
- name: sleep to give the snapshots time to shut down
pause:
minutes: 1
- debug:
msg: "Working on branch: {{perf_vm_domain | snap_name(baseline_branch, target_branch)}}"
- name: delete existing snapshots
command: "virsh snapshot-delete --domain {{perf_vm_domain}} --snapshotname='{{perf_vm_domain | snap_name(baseline_branch, target_branch)}}'"
- name: create new snapshots
command: "virsh snapshot-create-as {{perf_vm_domain}} --name='{{perf_vm_domain | snap_name(baseline_branch, target_branch)}}'"