|
5 | 5 | vars: |
6 | 6 | venv: "{{ virtualenv_path }}/openstack" |
7 | 7 | tasks: |
| 8 | + - name: Set up openstack cli virtualenv |
| 9 | + pip: |
| 10 | + virtualenv: "{{ venv }}" |
| 11 | + virtualenv_command: "/usr/bin/python3 -m venv" |
| 12 | + name: |
| 13 | + - python-openstackclient |
| 14 | + state: latest |
| 15 | + extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}" |
| 16 | + run_once: true |
| 17 | + delegate_to: "{{ groups['controllers'][0] }}" |
| 18 | + vars: |
| 19 | + ansible_host: "{{ hostvars[groups['controllers'][0]].ansible_host }}" |
| 20 | + when: stackhpc_enable_radosgw_usage_exporter |
| 21 | + |
8 | 22 | - name: Check ec2 credential for admin |
9 | 23 | command: > |
10 | 24 | {{ venv }}/bin/openstack |
11 | 25 | ec2 credentials list --user admin |
12 | 26 | --format json |
13 | 27 | environment: "{{ openstack_auth_env }}" |
14 | | - delegate_to: localhost |
15 | 28 | register: credential_check |
| 29 | + delegate_to: "{{ groups['controllers'][0] }}" |
| 30 | + vars: |
| 31 | + ansible_host: "{{ hostvars[groups['controllers'][0]].ansible_host }}" |
16 | 32 | run_once: true |
17 | 33 | when: stackhpc_enable_radosgw_usage_exporter |
18 | 34 |
|
|
22 | 38 | ec2 credentials create --user admin |
23 | 39 | --format json |
24 | 40 | environment: "{{ openstack_auth_env }}" |
25 | | - delegate_to: localhost |
| 41 | + delegate_to: "{{ groups['controllers'][0] }}" |
| 42 | + vars: |
| 43 | + ansible_host: "{{ hostvars[groups['controllers'][0]].ansible_host }}" |
26 | 44 | run_once: true |
27 | 45 | when: |
28 | 46 | - stackhpc_enable_radosgw_usage_exporter |
|
34 | 52 | ec2 credentials list --user admin |
35 | 53 | --format json |
36 | 54 | environment: "{{ openstack_auth_env }}" |
37 | | - delegate_to: localhost |
| 55 | + delegate_to: "{{ groups['controllers'][0] }}" |
| 56 | + vars: |
| 57 | + ansible_host: "{{ hostvars[groups['controllers'][0]].ansible_host }}" |
38 | 58 | register: credential |
39 | 59 | run_once: true |
40 | 60 | when: stackhpc_enable_radosgw_usage_exporter |
|
45 | 65 | endpoint list --service object-store --interface internal |
46 | 66 | --format json |
47 | 67 | environment: "{{ openstack_auth_env }}" |
48 | | - delegate_to: localhost |
| 68 | + delegate_to: "{{ groups['controllers'][0] }}" |
| 69 | + vars: |
| 70 | + ansible_host: "{{ hostvars[groups['controllers'][0]].ansible_host }}" |
49 | 71 | register: endpoint |
50 | 72 | run_once: true |
51 | 73 | when: stackhpc_enable_radosgw_usage_exporter |
|
0 commit comments