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.

30 lines
1.4 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: Checkout the hostpath-provisioner GIT Repository
git: dest={{ hostpath_provisioner_options.git_checkout_path }} repo={{ hostpath_provisioner_options.git_repo_url }}
become: no
- name: Process the OpenShift Template
shell: oc process -f setup/hostpath-provisioner-template.yaml -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 }}" > objects.json
args:
chdir: "{{ hostpath_provisioner_options.git_checkout_path }}"
become: no
- name: Create the OpenShift objects for the hostpath-provisioner
command: oc create -f objects.json
args:
chdir: "{{ hostpath_provisioner_git_checkout_path }}"