master.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ---
  2. - name: Perform OpenShift ServiceAccount config
  3. include_tasks: serviceaccount.yaml
  4. run_once: true
  5. - name: Create kuryr manifests tempdir
  6. command: mktemp -d
  7. register: manifests_tmpdir
  8. - name: Create OpenShift node's ImageStreamTag manifest
  9. become: yes
  10. template:
  11. src: node-images.yaml.j2
  12. dest: "{{ manifests_tmpdir.stdout }}/node-images.yaml"
  13. - name: Set certificate contents as fact
  14. set_fact:
  15. kuryr_ca_certificate: "{{ lookup('file', kuryr_openstack_ca | default(lookup('env', 'OS_CACERT'))) }}"
  16. ignore_errors: yes
  17. - name: Create Kuryr certificates Secret manifest
  18. become: yes
  19. template:
  20. src: certificates-secret.yaml.j2
  21. dest: "{{ manifests_tmpdir.stdout }}/certificates-secret.yaml"
  22. - name: Create kuryr ConfigMap manifest
  23. become: yes
  24. template:
  25. src: configmap.yaml.j2
  26. dest: "{{ manifests_tmpdir.stdout }}/configmap.yaml"
  27. - name: Create kuryr-controller Deployment manifest
  28. become: yes
  29. template:
  30. src: controller-deployment.yaml.j2
  31. dest: "{{ manifests_tmpdir.stdout }}/controller-deployment.yaml"
  32. - name: Create kuryr-cni DaemonSet manifest
  33. become: yes
  34. template:
  35. src: cni-daemonset.yaml.j2
  36. dest: "{{ manifests_tmpdir.stdout }}/cni-daemonset.yaml"
  37. - name: Create kuryrnet CRD manifest
  38. become: yes
  39. template:
  40. src: kuryrnet.yaml.j2
  41. dest: "{{ manifests_tmpdir.stdout }}/kuryrnet.yaml"
  42. when: openshift_kuryr_subnet_driver|default("default") == 'namespace'
  43. - name: Apply OpenShift node's ImageStreamTag manifest
  44. oc_obj:
  45. state: present
  46. kind: ImageStreamTag
  47. name: "node:v3.11"
  48. namespace: "{{ kuryr_namespace }}"
  49. files:
  50. - "{{ manifests_tmpdir.stdout }}/node-images.yaml"
  51. run_once: true
  52. ignore_errors: yes
  53. - name: Apply Kuryr certificates Secret
  54. oc_obj:
  55. state: present
  56. kind: Secret
  57. name: "kuryr-certificates"
  58. namespace: "{{ kuryr_namespace }}"
  59. files:
  60. - "{{ manifests_tmpdir.stdout }}/certificates-secret.yaml"
  61. run_once: true
  62. - name: Apply ConfigMap manifest
  63. oc_obj:
  64. state: present
  65. kind: ConfigMap
  66. name: "kuryr-config"
  67. namespace: "{{ kuryr_namespace }}"
  68. files:
  69. - "{{ manifests_tmpdir.stdout }}/configmap.yaml"
  70. run_once: true
  71. - name: Apply Controller Deployment manifest
  72. oc_obj:
  73. state: present
  74. kind: Deployment
  75. name: "kuryr-controller"
  76. namespace: "{{ kuryr_namespace }}"
  77. files:
  78. - "{{ manifests_tmpdir.stdout }}/controller-deployment.yaml"
  79. run_once: true
  80. - name: Apply kuryr-cni DaemonSet manifest
  81. oc_obj:
  82. state: present
  83. kind: DaemonSet
  84. name: "kuryr-cni-ds"
  85. namespace: "{{ kuryr_namespace }}"
  86. files:
  87. - "{{ manifests_tmpdir.stdout }}/cni-daemonset.yaml"
  88. run_once: true
  89. - name: Apply kuryrnet CRD manifest
  90. oc_obj:
  91. state: present
  92. kind: CustomResourceDefinition
  93. name: "kuryrnets"
  94. files:
  95. - "{{ manifests_tmpdir.stdout }}/kuryrnet.yaml"
  96. run_once: true
  97. when: openshift_kuryr_subnet_driver|default("default") == 'namespace'