diff options
author | Manuel Buil <mbuil@suse.com> | 2019-08-12 12:18:21 +0200 |
---|---|---|
committer | Manuel Buil <mbuil@suse.com> | 2019-08-12 13:12:07 +0000 |
commit | f72470b570382f565c7d82a21cbafed0767d9fbe (patch) | |
tree | 94245f0e9a20dcae434f591ce70053ee798343ea /xci/installer | |
parent | b77681d6c6ffc3da741e391436a5158d21dd47f6 (diff) |
Set the correct labels for noha
In noha mode, node1 and node2 is used for controller and compute roles.
This patch changes that making node1 only controller and node2 only
compute.
It also modifies a bit the syntax to make it more ansible friendly
deploy-scenario:k8-calico-nofeature
installer-type:osh
Change-Id: I3f40f59ea3c167914ea4c810f7dda60c75fb7175
Signed-off-by: Manuel Buil <mbuil@suse.com>
Diffstat (limited to 'xci/installer')
-rw-r--r-- | xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/tasks/main.yml | 16 | ||||
-rw-r--r-- | xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/vars/main.yml | 24 |
2 files changed, 26 insertions, 14 deletions
diff --git a/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/tasks/main.yml b/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/tasks/main.yml index b31dc706..72ae821f 100644 --- a/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/tasks/main.yml +++ b/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/tasks/main.yml @@ -4,21 +4,9 @@ changed_when: false - name: Set kubernetes node labels - shell: "for x in `kubectl get nodes --show-labels | grep 'node-role.kubernetes.io/node=true' | awk '{print $1}'`; do kubectl label nodes $x {{ item }}; done" - args: - executable: /bin/bash + command: "kubectl label nodes {{ item }} {{ node_labels[item]|join(' ') }}" changed_when: false - with_items: - - openstack-control-plane=enabled - - openstack-compute-node=enabled - - openstack-helm-node-class=primary - - openvswitch=enabled - - linuxbridge=enabled - - ceph-mon=enabled - - ceph-osd=enabled - - ceph-mds=enabled - - ceph-mgr=enabled - - ceph-rgw=enabled + with_items: "{{ groups['kube-node'] }}" - name: Create directories file: diff --git a/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/vars/main.yml b/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/vars/main.yml index 53188bdb..b40b5afb 100644 --- a/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/vars/main.yml +++ b/xci/installer/osh/playbooks/roles/prepare-opnfvhost-osh/vars/main.yml @@ -5,3 +5,27 @@ required_packages: - jq - nmap - bc + +node_labels: + node1: + - openstack-control-plane=enabled + - openstack-compute-node={{ (xci_flavor == 'mini') | ternary('enabled', 'disable') }} + - openstack-helm-node-class=primary + - openvswitch=enabled + - linuxbridge=enabled + - ceph-mon=enabled + - ceph-osd=enabled + - ceph-mds=enabled + - ceph-mgr=enabled + - ceph-rgw=enabled + node2: + - openstack-control-plane={{ (xci_flavor == 'noha') | ternary('disable', 'enabled') }} + - openstack-compute-node=enabled + - openstack-helm-node-class=primary + - openvswitch=enabled + - linuxbridge=enabled + - ceph-mon=enabled + - ceph-osd=enabled + - ceph-mds=enabled + - ceph-mgr=enabled + - ceph-rgw=enabled |