My Ansible Playbook to install an OpenShift Lab
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.5 KiB

---
- 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
- 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 -
- name: Copy the PersistentVolumeClaim object definition
copy: src=registry-storage-pvc.yaml dest=/tmp/registry-storage-pvc.yaml
- name: Create a PersistentVolumeClaim for the docker-registry
command: oc create -n default -f /tmp/registry-storage-pvc.yaml
- name: Add the new volume to docker-registry
command: oc volume dc docker-registry -n default --add=true --overwrite=true --type=persistentVolumeClaim --name=registry-storage --claim-name=registry-storage