Skip to content

Commit 13d1807

Browse files
Kayobe Automationassumptionsandg
authored andcommitted
Ensure venv exists
1 parent c43747f commit 13d1807

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

etc/kayobe/ansible/blazar-host-create.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@
33
hosts: blazar-compute
44
gather_facts: false
55
vars:
6-
venv: "/stack/kayobe-automation-env/venvs/os-venv"
6+
venv: "{{ virtualenv_path }}/blazar"
7+
venv_python: "{{ 'python' ~ ansible_facts.python.version.major ~ '.' ~ ansible_facts.python.version.minor }}"
78
tasks:
9+
- name: Set up openstack cli virtualenv
10+
ansible.builtin.pip:
11+
virtualenv: "{{ venv }}"
12+
virtualenv_command: "{{ venv_python }} -m venv"
13+
name:
14+
- python-openstackclient
15+
- python-blazarclient
16+
state: latest
17+
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
18+
run_once: true
19+
delegate_to: localhost
20+
become: true
21+
822
- name: List Blazar compute hosts
923
ansible.builtin.shell:
1024
cmd: |

0 commit comments

Comments
 (0)