diff --git a/roles/hostpath-provisioner/tasks/main.yml b/roles/hostpath-provisioner/tasks/main.yml index b4991e3..6b8d166 100644 --- a/roles/hostpath-provisioner/tasks/main.yml +++ b/roles/hostpath-provisioner/tasks/main.yml @@ -1,21 +1,10 @@ --- - - name: Create an empty hostpath_provisioner_options variable if it does not exist - set_fact: - hostpath_provisioner_options: {} - when: hostpath_provisioner_options is not defined - tags: vars - - - name: Provision default values for the hostpath_provisioner_options - set_fact: - hostpath_provisioner_options: "{{ hostpath_provisioner_default_options|combine(hostpath_provisioner_options) }}" - tags: vars - - name: Create a directory for the hostpath-provisioner - file: state=directory path={{ hostpath_provisioner_options.path }} owner=root group=root mode=0777 setype=svirt_sandbox_file_t + file: state=directory path={{ hostpath_provisioner_path }} owner=root group=root mode=0777 setype=svirt_sandbox_file_t - name: Process the OpenShift Template and create the OpenShift objects for the hostpath-provisioner - shell: oc process -f "{{ hostpath_provisioner_options.template }}" -p "HOSTPATH_TO_USE={{ hostpath_provisioner_options.path }}" -p "TARGET_NAMESPACE={{ hostpath_provisioner_options.target_namespace }}" -p "HOSTPATH_PROVISIONER_IMAGE={{ hostpath_provisioner_options.docker_image }}" | oc create -f - + shell: oc process -f "{{ hostpath_provisioner_template }}" -p "HOSTPATH_TO_USE={{ hostpath_provisioner_path }}" -p "TARGET_NAMESPACE={{ hostpath_provisioner_target_namespace }}" -p "HOSTPATH_PROVISIONER_IMAGE={{ hostpath_provisioner_docker_image }}" | oc create -f - - name: Copy the PersistentVolumeClaim object definition copy: src=registry-storage-pvc.yaml dest=/tmp/registry-storage-pvc.yaml diff --git a/roles/hostpath-provisioner/vars/main.yml b/roles/hostpath-provisioner/vars/main.yml index 9001c2e..b5cf52f 100644 --- a/roles/hostpath-provisioner/vars/main.yml +++ b/roles/hostpath-provisioner/vars/main.yml @@ -1,8 +1,7 @@ --- - hostpath_provisioner_default_options: - path: /var/openshift - target_namespace: default - docker_image: nmasse/openshift-hostpath-provisioner:latest - template: https://raw.githubusercontent.com/nmasse-itix/OpenShift-HostPath-Provisioner/master/setup/hostpath-provisioner-template.yaml - patch_docker_registry: true + hostpath_provisioner_path: /var/openshift + hostpath_provisioner_target_namespace: default + hostpath_provisioner_docker_image: nmasse/openshift-hostpath-provisioner:latest + hostpath_provisioner_template: https://raw.githubusercontent.com/nmasse-itix/OpenShift-HostPath-Provisioner/master/setup/hostpath-provisioner-template.yaml + hostpath_provisioner_patch_docker_registry: true