Skip to content

Commit

Permalink
Allow excluding IoT CRDs during Ansible installation (fixes EnMassePr…
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Jul 23, 2020
1 parent 3dfac5c commit b8c3bbd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
7 changes: 7 additions & 0 deletions ansible/roles/crds/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
- name: Install the CRDs
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/crds
shell: |
for i in $(find "{{ playbook_dir }}/install/crds" ! -name "010-iot*"); do oc apply -n {{ namespace }} -f "$i"; done
with: not enable_iot

- name: Install the IoT CRDs
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/crds
with: enable_iot
3 changes: 3 additions & 0 deletions ansible/roles/enmasse_operator/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
- name: Apply the EnMasse Operator
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/enmasse-operator
- name: Disable IoT modules
shell: oc set env deployment/enmasse-operator CONTROLLER_ENABLE_IOT_CONFIG=false CONTROLLER_ENABLE_IOT_PROJECT=false
when: not enable_iot
2 changes: 1 addition & 1 deletion ansible/roles/iot/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Apply the IoT CRD
- name: Apply the IoT API Roles
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/iot/api
- name: Apply the IoT Common
shell: oc apply -n {{ namespace }} -f {{ playbook_dir }}/install/iot/common
Expand Down
25 changes: 15 additions & 10 deletions cmd/controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,21 @@ func main() {
Version: "v1beta1",
Kind: "AddressList",
},
schema.GroupVersionKind{
Group: "iot.enmasse.io",
Version: "v1alpha1",
Kind: "IoTProject",
},
schema.GroupVersionKind{
Group: "iot.enmasse.io",
Version: "v1alpha1",
Kind: "IoTProjectList",
},
}

if util.IsModuleEnabled("IOT_PROJECT") {
globalGvks = append(globalGvks,
schema.GroupVersionKind{
Group: "iot.enmasse.io",
Version: "v1alpha1",
Kind: "IoTProject",
},
schema.GroupVersionKind{
Group: "iot.enmasse.io",
Version: "v1alpha1",
Kind: "IoTProjectList",
},
)
}

if util.IsModuleEnabled("MESSAGING_INFRASTRUCTURE") {
Expand Down

0 comments on commit b8c3bbd

Please sign in to comment.