Skip to content
Permalink
08ee9ca747
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
63 lines (50 sloc) 1.61 KB
---
- name: Install openshift dependencies
dnf:
name: [
origin-clients
]
state: present
# Setup openshift registry
- name: Add insecure-registries entry
replace:
path: /etc/containers/registries.conf
after: 'registries.insecure'
before: 'registries.block'
regexp: '^(registries =).*$'
replace: '\1 ["172.30.0.0/16"]'
- name: Restart registries
systemd:
state: restarted
name: registries
# https://bugzilla.redhat.com/show_bug.cgi?id=1558425
- name: Add cgroups to docker systemd service
replace:
path: /usr/lib/systemd/system/docker.service
regexp: '(native.cgroupdriver=)systemd'
replace: '\1cgroupfs'
- name: Start docker
systemd:
state: restarted
daemon_reload: yes
name: docker
- name: Start cluster
command: oc cluster up --enable=[router, registry, web-console]
- name: Add registry
command: oc cluster add registry
- name: Create project
command: oc new-project mbox
# Setup postgresql template
- name: Copy template
copy: src=postgresql-ephemeral-template.json dest=/tmp/postgresql-ephemeral-template.json
- name: Switch to admin user
command: oc login -u system:admin
- name: Install PostgreSQL templates
command: oc create -f "/tmp/postgresql-ephemeral-template.json" -n openshift
- name: Use centos registry for postgress imagestream
command: oc tag --scheduled=true registry.centos.org/postgresql/postgresql postgresql:latest
# Setup openshift router
- name: Grant router access to host network
command: oc adm policy add-scc-to-user hostnetwork -z router
- name: Deploy router
command: oc adm router --ports='8443'