-
Notifications
You must be signed in to change notification settings - Fork 1
/
play.yml
55 lines (53 loc) · 1.45 KB
/
play.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
---
- name: Create && Launch VMs
hosts: localhost
gather_facts: True
vars:
tools_owner_name: '{{ lookup("env","USER") }}'
tools_owner_home: '{{ lookup("env","HOME") }}'
local_whoami_home: '{{ tools_owner_home }}'
roles:
- cloud/os7
tasks:
- include_role: name=tools/gatling
- include_role: name=tools/jmeter
- include_role: name=tools/locust
- include_role: name=tools/maven
- include_role: name=tools/oc
- name: Install Performance Tooling
hosts: masters:slaves
gather_facts: '{{ hostvars["localhost"]["cloud_destroyed"]|default(False)|ternary(False, True) }}'
vars:
tools_owner_name: 'jenkins'
tools_owner_home: '/var/lib/jenkins'
local_whoami_home: '{{ lookup("env","HOME") }}'
pre_tasks:
- meta: end_play
when: hostvars["localhost"]["cloud_destroyed"]|default(False)
roles:
- system/docker
- system/ohmyzsh
- tools/gatling
- tools/jmeter
- tools/locust
- tools/maven
- tools/oc
- zabbix
post_tasks:
- copy:
src: '{{ local_whoami_home }}/.ssh/ec2.jenkins'
dest: '{{ tools_owner_home }}/.ssh/id_rsa'
mode: 0600
remote_src: no
become: yes
become_user: '{{ tools_owner_name }}'
when: inventory_hostname_short in groups["masters"]
- name: Add VMs to Jenkins master
hosts: localhost
gather_facts: no
vars:
local_whoami_home: '{{ lookup("env","HOME") }}'
vars_files:
- secret.yml
roles:
- pjenkins