forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathocp-workload.yml
33 lines (31 loc) · 898 Bytes
/
ocp-workload.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
---
# This playbook is only here as a convenient way to manually apply a workload
# to an host.
- name: Deploy a workload role on a master host
hosts: all
become: false
gather_facts: false
tags:
- step007
tasks:
- name: Check if desired virtualenv is available on the host
stat:
path: "/opt/virtualenvs/k8s/bin/python"
register: r_virtualenv
- name: Set Ansible Python interpreter to virtualenv
when: r_virtualenv.stat.exists
set_fact:
ansible_python_interpreter: "/opt/virtualenvs/k8s/bin/python"
- name: Run single workload
include_role:
name: "{{ ocp_workload }}"
when: ocp_workload is defined
- name: Run multiple workloads
when:
- ocp_workloads is defined
- ocp_workloads | length > 0
loop: "{{ ocp_workloads }}"
loop_control:
loop_var: _ocp_workload
include_role:
name: "{{ _ocp_workload }}"