|
@@ -4,25 +4,30 @@
|
|
|
msg: "openshift_node_problem_detector_image_pull_policy must be one of Always, Never, IfNotPresent. Got {{ openshift_node_problem_detector_image_pull_policy }}"
|
|
|
when: openshift_node_problem_detector_image_pull_policy not in ['Always', 'Never', 'IfNotPresent']
|
|
|
|
|
|
+- name: Ensure Node Problem Detector project exists
|
|
|
+ oc_project:
|
|
|
+ name: openshift-node-problem-detector
|
|
|
+ state: present
|
|
|
+
|
|
|
- name: create Node Problem Detector service account
|
|
|
oc_serviceaccount:
|
|
|
name: "{{ openshift_node_problem_detector_service_account }}"
|
|
|
- namespace: "{{ openshift_node_problem_detector_namespace }}"
|
|
|
+ namespace: openshift-node-problem-detector
|
|
|
state: present
|
|
|
|
|
|
- name: bind node-problem-detector cluster role to the node-problem-detector service account
|
|
|
oc_adm_policy_user:
|
|
|
state: present
|
|
|
- user: "system:serviceaccount:{{ openshift_node_problem_detector_namespace }}:{{ openshift_node_problem_detector_service_account }}"
|
|
|
- namespace: "{{ openshift_node_problem_detector_namespace }}"
|
|
|
+ user: "system:serviceaccount:openshift-node-problem-detector:{{ openshift_node_problem_detector_service_account }}"
|
|
|
+ namespace: "openshift-node-problem-detector"
|
|
|
resource_kind: cluster-role
|
|
|
resource_name: "system:{{ openshift_node_problem_detector_cluster_role_name }}"
|
|
|
|
|
|
- name: Grant privileged SCC from node problem detector service account
|
|
|
oc_adm_policy_user:
|
|
|
state: present
|
|
|
- user: "system:serviceaccount:{{ openshift_node_problem_detector_namespace }}:{{ openshift_node_problem_detector_service_account }}"
|
|
|
- namespace: "{{ openshift_node_problem_detector_namespace }}"
|
|
|
+ user: "system:serviceaccount:openshift-node-problem-detector:{{ openshift_node_problem_detector_service_account }}"
|
|
|
+ namespace: openshift-node-problem-detector
|
|
|
resource_kind: scc
|
|
|
resource_name: privileged
|
|
|
|
|
@@ -35,7 +40,7 @@
|
|
|
oc_configmap:
|
|
|
state: present
|
|
|
name: "{{ openshift_node_problem_detector_configmap_name }}"
|
|
|
- namespace: "{{ openshift_node_problem_detector_namespace }}"
|
|
|
+ namespace: openshift-node-problem-detector
|
|
|
from_literal: "{{ openshift_node_problem_detector_configmap.data }}"
|
|
|
|
|
|
- name: create node problem detector
|
|
@@ -47,7 +52,7 @@
|
|
|
oc_obj:
|
|
|
kind: daemonset
|
|
|
name: "{{ openshift_node_problem_detector_daemonset_name }}"
|
|
|
- namespace: "{{ openshift_node_problem_detector_namespace }}"
|
|
|
+ namespace: openshift-node-problem-detector
|
|
|
state: present
|
|
|
files:
|
|
|
- "{{ openshift_node_problem_detector_tmp_location }}/npd-ds.yaml"
|