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.

38 lines
1.3 KiB

---
- name: Create a temporary directory
tempfile:
state: directory
register: tempfile
when: 'is_offline|default(False)|bool'
- name: Push the JBoss ImageStreams to the target
copy:
src: '{{ jboss_image_streams }}'
dest: '{{ tempfile.path }}/{{ jboss_image_streams|basename }}'
when: 'is_offline|default(False)|bool'
- set_fact:
jboss_image_streams: '{{ tempfile.path }}/{{ jboss_image_streams|basename }}'
when: 'is_offline|default(False)|bool'
- name: Install new JBoss ImageStreams
command: oc create -n openshift -f "{{ jboss_image_streams }}"
register: oc
failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr
changed_when: oc.rc == 0
- name: Update existing JBoss ImageStreams
command: oc replace -n openshift -f "{{ jboss_image_streams }}"
register: oc
failed_when: oc.rc > 0 and 'Error from server (NotFound):' not in oc.stderr
changed_when: oc.rc == 0
- name: Update the router to allow Wildcards
command: oc set env dc/router ROUTER_ALLOW_WILDCARD_ROUTES=true -n default
- name: Update the dnsmasq configuration to reference the wildcard DNS entry
template: src=wildcard.conf dest=/etc/dnsmasq.d/wildcard.conf
- name: Restart the dnsmasq service
service: name=dnsmasq enabled=yes state=restarted