12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- ---
- - name: add a sa
- oc_serviceaccount:
- name: "{{ openshift_daemonset_config_sa_name }}"
- namespace: "{{ openshift_daemonset_config_namespace }}"
- - name: add sa to privileged scc
- oc_adm_policy_user:
- namespace: "{{ openshift_daemonset_config_namespace }}"
- resource_kind: scc
- resource_name: privileged
- state: present
- user: "system:serviceaccount:{{ openshift_daemonset_config_namespace }}:{{ openshift_daemonset_config_sa_name }}"
- - name: copy template to disk
- template:
- dest: "/tmp/{{ item.name }}"
- src: "{{ item.name }}.j2"
- with_items:
- - name: daemonset.yml
- - name: copy files to disk
- copy:
- src: "{{ item.key }}"
- dest: "{{ item.value }}"
- with_dict: "{{ openshift_daemonset_config_configmap_files }}"
- - name: create the namespace
- oc_project:
- state: present
- name: "{{ openshift_daemonset_config_namespace }}"
- - name: lay down secrets
- oc_secret:
- state: present
- name: "{{ openshift_daemonset_config_secret_name }}"
- namespace: "{{ openshift_daemonset_config_namespace }}"
- delete_after: true
- contents: "{{ openshift_daemonset_config_secrets }}"
- when:
- - openshift_daemonset_config_secrets != {}
- - name: create the configmap
- oc_configmap:
- state: present
- name: "{{ openshift_daemonset_config_configmap_name }}"
- namespace: "{{ openshift_daemonset_config_namespace }}"
- from_literal: "{{ openshift_daemonset_config_configmap_literals }}"
- from_file: "{{ openshift_daemonset_config_configmap_files }}"
- - name: deploy daemonset
- oc_obj:
- state: present
- namespace: "{{ openshift_daemonset_config_namespace }}" # openshift-node??
- name: "{{ openshift_daemonset_config_daemonset_name }}"
- kind: daemonset
- files:
- - /tmp/daemonset.yml
|