remove.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ---
  2. - name: remove ansible-service-broker serviceaccount
  3. oc_serviceaccount:
  4. name: asb
  5. namespace: openshift-ansible-service-broker
  6. state: absent
  7. - name: remove ansible-service-broker client serviceaccount
  8. oc_serviceaccount:
  9. name: asb-client
  10. namespace: openshift-ansible-service-broker
  11. state: absent
  12. - name: remove asb-auth cluster role
  13. oc_clusterrole:
  14. state: absent
  15. name: asb-auth
  16. - name: remove asb-access cluster role
  17. oc_clusterrole:
  18. state: absent
  19. name: asb-access
  20. - name: Unbind admin cluster-role to asb serviceaccount
  21. oc_adm_policy_user:
  22. state: absent
  23. namespace: openshift-ansible-service-broker
  24. resource_kind: cluster-role
  25. resource_name: admin
  26. user: "system:serviceaccount:openshift-ansible-service-broker:asb"
  27. - name: Unbind auth cluster role to asb service account
  28. oc_adm_policy_user:
  29. state: absent
  30. namespace: openshift-ansible-service-broker
  31. resource_kind: cluster-role
  32. resource_name: asb-auth
  33. user: "system:serviceaccount:openshift-ansible-service-broker:asb"
  34. - name: Unbind asb-access role to asb-client service account
  35. oc_adm_policy_user:
  36. state: absent
  37. namespace: openshift-ansible-service-broker
  38. resource_kind: cluster-role
  39. resource_name: asb-access
  40. user: "system:serviceaccount:openshift-ansible-service-broker:asb-client"
  41. - name: remove asb-client token secret
  42. oc_secret:
  43. state: absent
  44. name: asb-client
  45. namespace: openshift-ansible-service-broker
  46. - name: remove ansible-service-broker service
  47. oc_service:
  48. name: asb
  49. namespace: openshift-ansible-service-broker
  50. state: absent
  51. - name: remove etcd service
  52. oc_service:
  53. name: etcd
  54. namespace: openshift-ansible-service-broker
  55. state: absent
  56. - name: remove route for ansible-service-broker service
  57. oc_route:
  58. name: asb-1338
  59. namespace: openshift-ansible-service-broker
  60. state: absent
  61. - name: remove persistent volume claim for etcd
  62. oc_pvc:
  63. name: etcd
  64. namespace: openshift-ansible-service-broker
  65. state: absent
  66. - name: remove Ansible Service Broker deployment config
  67. oc_obj:
  68. name: asb
  69. namespace: openshift-ansible-service-broker
  70. kind: DeploymentConfig
  71. state: absent
  72. - name: remove secret for broker auth
  73. oc_obj:
  74. name: asb-auth-secret
  75. namespace: openshift-ansible-service-broker
  76. kind: Broker
  77. state: absent
  78. # TODO: saw a oc_configmap in the library, but didn't understand how to get it to do the following:
  79. - name: remove config map for ansible-service-broker
  80. oc_obj:
  81. name: broker-config
  82. namespace: openshift-ansible-service-broker
  83. state: absent
  84. kind: ConfigMap
  85. # TODO: Is this going to work?
  86. - name: remove broker object from the catalog
  87. oc_obj:
  88. name: ansible-service-broker
  89. state: absent
  90. kind: ServiceBroker
  91. - name: remove openshift-ansible-service-broker project
  92. oc_project:
  93. name: openshift-ansible-service-broker
  94. state: absent