Skip to content

Commit b8c3bbd

Browse files
committed
Allow excluding IoT CRDs during Ansible installation (fixes EnMasseProject#5046)
1 parent 3dfac5c commit b8c3bbd

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

ansible/roles/crds/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
---
22
- name: Install the CRDs
33
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/crds
4+
shell: |
5+
for i in $(find "{{ playbook_dir }}/install/crds" ! -name "010-iot*"); do oc apply -n {{ namespace }} -f "$i"; done
6+
with: not enable_iot
7+
8+
- name: Install the IoT CRDs
9+
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/crds
10+
with: enable_iot
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
---
22
- name: Apply the EnMasse Operator
33
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/enmasse-operator
4+
- name: Disable IoT modules
5+
shell: oc set env deployment/enmasse-operator CONTROLLER_ENABLE_IOT_CONFIG=false CONTROLLER_ENABLE_IOT_PROJECT=false
6+
when: not enable_iot

ansible/roles/iot/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Apply the IoT CRD
2+
- name: Apply the IoT API Roles
33
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/iot/api
44
- name: Apply the IoT Common
55
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/iot/common

cmd/controller-manager/main.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,21 @@ func main() {
162162
Version: "v1beta1",
163163
Kind: "AddressList",
164164
},
165-
schema.GroupVersionKind{
166-
Group: "iot.enmasse.io",
167-
Version: "v1alpha1",
168-
Kind: "IoTProject",
169-
},
170-
schema.GroupVersionKind{
171-
Group: "iot.enmasse.io",
172-
Version: "v1alpha1",
173-
Kind: "IoTProjectList",
174-
},
165+
}
166+
167+
if util.IsModuleEnabled("IOT_PROJECT") {
168+
globalGvks = append(globalGvks,
169+
schema.GroupVersionKind{
170+
Group: "iot.enmasse.io",
171+
Version: "v1alpha1",
172+
Kind: "IoTProject",
173+
},
174+
schema.GroupVersionKind{
175+
Group: "iot.enmasse.io",
176+
Version: "v1alpha1",
177+
Kind: "IoTProjectList",
178+
},
179+
)
175180
}
176181

177182
if util.IsModuleEnabled("MESSAGING_INFRASTRUCTURE") {

0 commit comments

Comments
 (0)