Skip to content

Commit efd9bb4

Browse files
committed
Add get-cloud-facts.yml
Added playbook to dump facts such as number of nodes, deployed OpenStack services and networking info.
1 parent ac471d7 commit efd9bb4

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
- name: Gather Cloud Facts
3+
hosts: localhost
4+
gather_facts: true
5+
tasks:
6+
- name: Write facts to file
7+
vars:
8+
cloud_facts:
9+
ansible_control_host_distribution: "{{ ansible_facts.distribution }}"
10+
ansible_control_host_distribution_release: "{{ ansible_facts.distribution_release }}"
11+
openstack_release: "{{ openstack_release }}"
12+
openstack_release_name: "{{ openstack_release_codename }}"
13+
ansible_control_host_is_vm: "{{ ansible_facts.virtualization_role == 'guest' }}"
14+
controller_count: "{{ groups['controllers'] | length }}"
15+
hypervisor_count: "{{ groups['hypervisors'] | length }}"
16+
monitoring_count: "{{ groups['monitoring'] | length }}"
17+
osd_count: "{{ groups['osds'] | length }}"
18+
compute_count: "{{ groups['compute'] | length }}"
19+
baremetal_count: "{{ groups['baremetal-compute'] | length }}"
20+
ceph_deployed: "{{ groups['ceph'] | length > 0 | bool }}"
21+
ceph_count: "{{ groups['ceph'] | length }}"
22+
ceph_release: "{{ cephadm_ceph_release }}"
23+
storage_hyperconverged: "{{ groups['controllers'] | intersect(groups['osds']) | length > 0 | bool }}"
24+
wazuh_enabled: "{{ groups['wazuh-agent'] | length > 0 | bool }}"
25+
kayobe_managed_switches: "{{ groups['switches'] | length > 0 | bool }}"
26+
proxy_configured: "{{ http_proxy | bool or https_proxy | bool }}"
27+
bifrost_version: "{{ kolla_bifrost_source_version }}"
28+
barbican_enabled: "{{ kolla_enable_barbican }}"
29+
nova_enabled: "{{ kolla_enable_nova }}"
30+
neutron_enabled: "{{ kolla_enable_neutron }}"
31+
ovs_enabled: "{{ kolla_enable_openvswitch }}"
32+
ovn_enabled: "{{ kolla_enable_ovn }}"
33+
glance_enabled: "{{ kolla_enable_glance }}"
34+
cinder_enabled: "{{ kolla_enable_cinder }}"
35+
keystone_enabled: "{{ kolla_enable_keystone }}"
36+
horizon_enabled: "{{ kolla_enable_horizon }}"
37+
fluentd_enabled: "{{ kolla_enable_fluentd }}"
38+
rabbitmq_enabled: "{{ kolla_enable_rabbitmq }}"
39+
mariadb_enabled: "{{ kolla_enable_mariadb }}"
40+
mariabackup_enabled: "{{ kolla_enable_mariabackup }}"
41+
memcached_enabled: "{{ kolla_enable_memcached }}"
42+
haproxy_enabled: "{{ kolla_enable_haproxy }}"
43+
keepalived_enabled: "{{ kolla_enable_keepalived }}"
44+
octavia_enabled: "{{ kolla_enable_octavia }}"
45+
designate_enabled: "{{ kolla_enable_designate }}"
46+
manila_enabled: "{{ kolla_enable_manila }}"
47+
magnum_enabled: "{{ kolla_enable_magnum }}"
48+
heat_enabled: "{{ kolla_enable_heat }}"
49+
ironic_enabled: "{{ kolla_enable_ironic }}"
50+
skyline_enabled: "{{ kolla_enable_skyline }}"
51+
blazar_enabled: "{{ kolla_enable_blazar }}"
52+
pulp_enabled: "{{ seed_pulp_container_enabled }}"
53+
opensearch_enabled: "{{ kolla_enable_opensearch }}"
54+
openearch_dashboards_enabled: "{{ kolla_enable_opensearch_dashboards }}"
55+
influxdb_enabled: "{{ kolla_enable_influxdb }}"
56+
grafana_enabled: "{{ kolla_enable_grafana }}"
57+
prometheus_enabled: "{{ kolla_enable_prometheus }}"
58+
cloudkitty_enabled: "{{ kolla_enable_cloudkitty }}"
59+
telegraf_enabled: "{{ kolla_enable_telegraf }}"
60+
internal_tls_enabled: "{{ kolla_enable_tls_internal }}"
61+
external_tls_enabled: "{{ kolla_enable_tls_external }}"
62+
firewalld_enabled_all: "{{ controller_firewalld_enabled and compute_firewalld_enabled and storage_firewalld_enabled and monitoring_firewalld_enabled and infra_vm_firewalld_enabled and seed__firewalld_enabled and seed_hypervisor_firewalld_enabled}}"
63+
firewalld_enabled_any: "{{ controller_firewalld_enabled or compute_firewalld_enabled or storage_firewalld_enabled or monitoring_firewalld_enabled or infra_vm_firewalld_enabled or seed__firewalld_enabled or seed_hypervisor_firewalld_enabled }}"
64+
stackhpc_package_repos_enabled: "{{ stackhpc_repos_enabled }}"
65+
pulp_tls_enabled: "{{ pulp_enable_tls }}"
66+
kolla_image_tags: "{{ kolla_image_tags }}"
67+
ansible.builtin.copy:
68+
content: "{{ cloud_facts | to_nice_json(sort_keys=false) }}"
69+
dest: ~/cloud-facts.json

0 commit comments

Comments
 (0)