From 5ee781bd0433c018803c9983ae433fdceef846d9 Mon Sep 17 00:00:00 2001 From: Bjoern Teipel Date: Mon, 22 Jan 2024 16:28:04 -0600 Subject: [PATCH] Update openstack-enterprise inventory (#29) * Update openstack-enterprise inventory - Rename nova_compute_nodes to openstack_compute_nodes - Fix k8s-cluster group name for OSA to k8s converter * Adding basedir for bootstrap to allow it to be called from the outside --- bootstrap.sh | 3 ++ openstack-enterprise/inventory-example.yaml | 50 +++++++++++++++++++++ openstack-flex/inventory-example.yaml | 2 +- scripts/convert_osa_inventory.py | 4 +- 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 openstack-enterprise/inventory-example.yaml diff --git a/bootstrap.sh b/bootstrap.sh index 18132986..83ac98b7 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -16,6 +16,9 @@ export LC_ALL=C.UTF-8 mkdir -p ~/.venvs +BASEDIR=$(dirname $0) +cd $BASEDIR || error "Could not change to $BASEDIR" + source scripts/lib/functions.sh # Which config to bootstrap diff --git a/openstack-enterprise/inventory-example.yaml b/openstack-enterprise/inventory-example.yaml new file mode 100644 index 00000000..2b565df1 --- /dev/null +++ b/openstack-enterprise/inventory-example.yaml @@ -0,0 +1,50 @@ +# Inventory file for a small lab environment +# +all: + hosts: + controller1: + ansible_host: 10.240.0.51 + access_ip: 10.240.0.51 + controller2: + ansible_host: 10.240.0.52 + access_ip: 10.240.0.52 + controller3: + ansible_host: 10.240.0.53 + access_ip: 10.240.0.53 + worker1: + ansible_host: 10.240.0.54 + access_ip: 10.240.0.54 + worker2: + ansible_host: 10.240.0.55 + access_ip: 10.240.0.55 + children: + k8s_cluster: + vars: + cluster_name: cluster.local # This clustername should be changed to match your environment domain name. + children: + kube_control_plane: # all k8s control plane nodes need to be in this group + hosts: + controller1: null + controller2: null + controller3: null + etcd: # all etcd nodes need to be in this group + hosts: + controller1: null + controller2: null + controller3: null + kube_node: # all k8s enabled nodes need to be in this group + hosts: + controller1: null + controller2: null + controller3: null + worker1: null + worker2: null + openstack_control_plane: # nodes used for nova compute labeled as openstack-control-plane=enabled + hosts: + controller1: null + controller2: null + controller3: null + openstack_compute_nodes: # nodes used for nova compute labeled as openstack-compute-node=enabled + hosts: + worker1: null + worker2: null diff --git a/openstack-flex/inventory-example.yaml b/openstack-flex/inventory-example.yaml index 5f76e6ec..359850f3 100644 --- a/openstack-flex/inventory-example.yaml +++ b/openstack-flex/inventory-example.yaml @@ -132,7 +132,7 @@ all: storage-12481.rackerlabs.dev.local: null storage-12562.rackerlabs.dev.local: null storage-13461.rackerlabs.dev.local: null - nova_compute_nodes: # nodes used for nova compute labeled as openstack-compute-node=enabled + openstack_compute_nodes: # nodes used for nova compute labeled as openstack-compute-node=enabled hosts: compute-13461.rackerlabs.dev.local: null compute-12562.rackerlabs.dev.local: null diff --git a/scripts/convert_osa_inventory.py b/scripts/convert_osa_inventory.py index 435ab812..1d3a35ab 100755 --- a/scripts/convert_osa_inventory.py +++ b/scripts/convert_osa_inventory.py @@ -157,12 +157,12 @@ def main(debug=False, **kwargs): 'openstack-compute-node': { 'hosts': {} }, - 'k8s-cluster': { + 'k8s_cluster': { 'children': { 'kube-master': {}, 'kube-node': {}, 'openstack_control_plane': {}, - 'openstack-compute-node': {}, + 'openstack_compute_node': {}, } }, 'calico-rr': {