Browse Source

use tempfile, see #6

master
Nicolas Massé 8 years ago
parent
commit
f2e6704576
  1. 8
      roles/hostpath-provisioner/tasks/main.yml

8
roles/hostpath-provisioner/tasks/main.yml

@ -19,12 +19,16 @@
failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr
changed_when: oc.rc == 0
- name: Create a temporary directory to hold the PVC YAML file
tempfile: state=directory
register: tempfile
- name: Copy the PersistentVolumeClaim object definition
copy: src=registry-storage-pvc.yaml dest=/tmp/registry-storage-pvc.yaml
copy: src=registry-storage-pvc.yaml dest={{tempfile.path}}/registry-storage-pvc.yaml
when: hostpath_provisioner_options.patch_docker_registry
- name: Create a PersistentVolumeClaim for the docker-registry
command: oc create -n default -f /tmp/registry-storage-pvc.yaml
command: oc create -n default -f {{tempfile.path}}/registry-storage-pvc.yaml
when: hostpath_provisioner_patch_docker_registry
register: oc
failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr

Loading…
Cancel
Save