summaryrefslogtreecommitdiffstats
path: root/playbooks/roles/bmra-config
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/roles/bmra-config')
-rw-r--r--playbooks/roles/bmra-config/tasks/main.yaml4
-rw-r--r--playbooks/roles/bmra-config/templates/inventory.ini20
2 files changed, 24 insertions, 0 deletions
diff --git a/playbooks/roles/bmra-config/tasks/main.yaml b/playbooks/roles/bmra-config/tasks/main.yaml
new file mode 100644
index 0000000..19b011a
--- /dev/null
+++ b/playbooks/roles/bmra-config/tasks/main.yaml
@@ -0,0 +1,4 @@
+- name: write BMRA config
+ template:
+ src: "inventory.ini"
+ dest: "{{ kuberef_root }}/sw_config/bmra/inventory.ini"
diff --git a/playbooks/roles/bmra-config/templates/inventory.ini b/playbooks/roles/bmra-config/templates/inventory.ini
new file mode 100644
index 0000000..48ca5fd
--- /dev/null
+++ b/playbooks/roles/bmra-config/templates/inventory.ini
@@ -0,0 +1,20 @@
+[all]
+{% for node in nodes %}
+{{ idf.kubespray.hostnames[node.name] }} ansible_host={{ node.interfaces[idf.net_config[engine.pxe_network].interface].address }} ip={{ node.interfaces[idf.net_config[engine.pxe_network].interface].address }}
+{% endfor %}
+
+{% for role in ['kube-master', 'etcd', 'kube-node'] %}
+[{{ role }}]
+{% for node in nodes %}
+{% if role in idf.kubespray.nodes_roles[node.name] %}
+{{ idf.kubespray.hostnames[node.name] }}
+{% endif %}
+{% endfor %}
+
+{% endfor %}
+
+[k8s-cluster:children]
+kube-master
+kube-node
+
+[calico-rr]