Skip to content

Commit a021da8

Browse files
author
Ubuntu
committed
edits from review
1 parent 1bfbb2b commit a021da8

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

etc/kayobe/ansible/get-cloud-facts.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Get facts for control host
2+
- name: Set facts for control host
33
hosts: localhost
44
gather_facts: true
55
tasks:
@@ -9,15 +9,15 @@
99
{{ 'genericswitch' in kolla_neutron_ml2_mechanism_drivers | default(false) }}
1010
when: kolla_neutron_ml2_mechanism_drivers
1111

12-
- name: Get facts for seed node
12+
- name: Set facts for seed node
1313
hosts: seed
1414
gather_facts: true
1515
tasks:
1616
- name: Is there a dedicated seed node?
1717
ansible.builtin.set_fact:
1818
seed_node_is_vm: "{{ ansible_facts.virtualization_role == 'guest' }}"
1919

20-
- name: Get facts
20+
- name: Set facts for all hosts
2121
hosts: all
2222
gather_facts: true
2323
tasks:
@@ -27,24 +27,11 @@
2727
timeout: 5
2828
ignore_errors: true
2929

30-
- name: Set internet connectivity fact
31-
ansible.builtin.set_fact:
32-
internet_connectivity: "{{ not successful_ping.failed }}"
33-
- name: Get OS distribution
34-
ansible.builtin.set_fact:
35-
distribution: "{{ ansible_facts.distribution }}"
36-
37-
38-
- name: Get OS distribution release
39-
ansible.builtin.set_fact:
40-
distribution_release: "{{ ansible_facts.distribution_release }}"
41-
42-
4330
- name: Get kernel version
4431
ansible.builtin.command: "uname -r"
4532
register: kernel_version
4633

47-
- name: Check if docker is installed
34+
- name: Check if Docker is installed
4835
ansible.builtin.command: "which docker"
4936
register: docker_check
5037
failed_when: docker_check.rc not in [0]
@@ -56,11 +43,14 @@
5643
register: containers_list
5744
when: not docker_check.failed
5845

59-
- name: Check if hugepages enabled
46+
- name: Set facts
6047
ansible.builtin.set_fact:
48+
internet_connectivity: "{{ not successful_ping.failed }}"
49+
distribution: "{{ ansible_facts.distribution }}"
50+
distribution_release: "{{ ansible_facts.distribution_release }}"
6151
hugepages_enabled: "{{ 'hugepages' in ansible_facts.cmdline }}"
6252

63-
- name: Gather Cloud Facts
53+
- name: Write cloud facts file
6454
hosts: localhost
6555
gather_facts: true
6656
tasks:
@@ -117,7 +107,7 @@
117107
pulp_tls_enabled: "{{ pulp_enable_tls }}"
118108
kolla_image_tags: "{{ kolla_image_tags }}"
119109
gpu_passthrough_enabled: "{{ gpu_group_map | length > 0 | bool }}"
120-
vGPU_enabled: "{{ groups['vgpu'] | length > 0 | bool }}"
110+
vgpu_enabled: "{{ groups['vgpu'] | length > 0 | bool }}"
121111
hugepages_enabled: "{{ hostvars | group_hostvars_by_var('hugepages_enabled') }}"
122112
ansible.builtin.copy:
123113
content: "{{ cloud_facts | to_nice_json(sort_keys=false) }}"

0 commit comments

Comments
 (0)