Rename install-openshift to ensure-openshift for consistency
The old role will be kept and include ensure-openshift for backwards-compatability. Change-Id: I6ff81fbd04f25207c87834b36e4d636eb9d44a93
This commit is contained in:
parent
fcf3202ba4
commit
276a5e919a
@ -7,6 +7,7 @@ Container Roles
|
||||
.. zuul:autorole:: deploy-openshift
|
||||
.. zuul:autorole:: ensure-docker
|
||||
.. zuul:autorole:: ensure-kubernetes
|
||||
.. zuul:autorole:: ensure-openshift
|
||||
.. zuul:autorole:: install-docker
|
||||
.. zuul:autorole:: install-kubernetes
|
||||
.. zuul:autorole:: install-openshift
|
||||
|
16
roles/ensure-openshift/README.rst
Normal file
16
roles/ensure-openshift/README.rst
Normal file
@ -0,0 +1,16 @@
|
||||
Setup openshift requirements and pull the container images.
|
||||
The deploy-openshift role can be used to start the services.
|
||||
|
||||
This role only works on CentOS.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: origin_repo
|
||||
:default: centos-release-openshift-origin39
|
||||
|
||||
The origin repository.
|
||||
|
||||
.. zuul:rolevar:: origin_version
|
||||
:default: v3.9.0
|
||||
|
||||
The origin version.
|
66
roles/ensure-openshift/tasks/main.yaml
Normal file
66
roles/ensure-openshift/tasks/main.yaml
Normal file
@ -0,0 +1,66 @@
|
||||
- name: Install origin repository
|
||||
yum:
|
||||
name: "{{ origin_repo }}"
|
||||
become: yes
|
||||
|
||||
- name: Install requirements
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
- origin
|
||||
- docker
|
||||
become: yes
|
||||
|
||||
- name: Fix docker start options
|
||||
lineinfile:
|
||||
dest: /etc/sysconfig/docker
|
||||
regexp: "^OPTIONS="
|
||||
line: "OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --insecure-registry 172.30.0.0/16'"
|
||||
become: yes
|
||||
|
||||
# See: https://github.com/openshift/origin/issues/15038
|
||||
- name: Fix rhel secret issue
|
||||
file:
|
||||
path: /usr/share/rhel/secrets
|
||||
state: absent
|
||||
become: yes
|
||||
|
||||
- name: Ensure "docker" group exists
|
||||
become: true
|
||||
group:
|
||||
name: docker
|
||||
state: present
|
||||
|
||||
- name: Add user to docker group
|
||||
become: true
|
||||
user:
|
||||
name: "{{ ansible_user }}"
|
||||
groups:
|
||||
- docker
|
||||
append: yes
|
||||
|
||||
- name: Start docker service
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
become: yes
|
||||
|
||||
- name: Pull origin images
|
||||
command: "docker pull docker.io/openshift/{{ item }}:{{ origin_version }}"
|
||||
with_items:
|
||||
- origin-web-console
|
||||
- origin-docker-registry
|
||||
- origin-haproxy-router
|
||||
- origin-deployer
|
||||
- origin-pod
|
||||
- origin
|
||||
become: yes
|
||||
|
||||
- name: Set group ownership of docker socket
|
||||
become: true
|
||||
file:
|
||||
path: /var/run/docker.sock
|
||||
group: docker
|
||||
|
||||
- name: Reset ssh connection to pick up docker group
|
||||
meta: reset_connection
|
@ -1,16 +1 @@
|
||||
Setup openshift requirements and pull the container images.
|
||||
The deploy-openshift role can be used to start the services.
|
||||
|
||||
This role only works on CentOS.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: origin_repo
|
||||
:default: centos-release-openshift-origin39
|
||||
|
||||
The origin repository.
|
||||
|
||||
.. zuul:rolevar:: origin_version
|
||||
:default: v3.9.0
|
||||
|
||||
The origin version.
|
||||
.. warning:: Deprecated, use ensure-openshift instead.
|
||||
|
@ -1,66 +1,3 @@
|
||||
- name: Install origin repository
|
||||
yum:
|
||||
name: "{{ origin_repo }}"
|
||||
become: yes
|
||||
|
||||
- name: Install requirements
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
- origin
|
||||
- docker
|
||||
become: yes
|
||||
|
||||
- name: Fix docker start options
|
||||
lineinfile:
|
||||
dest: /etc/sysconfig/docker
|
||||
regexp: "^OPTIONS="
|
||||
line: "OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --insecure-registry 172.30.0.0/16'"
|
||||
become: yes
|
||||
|
||||
# See: https://github.com/openshift/origin/issues/15038
|
||||
- name: Fix rhel secret issue
|
||||
file:
|
||||
path: /usr/share/rhel/secrets
|
||||
state: absent
|
||||
become: yes
|
||||
|
||||
- name: Ensure "docker" group exists
|
||||
become: true
|
||||
group:
|
||||
name: docker
|
||||
state: present
|
||||
|
||||
- name: Add user to docker group
|
||||
become: true
|
||||
user:
|
||||
name: "{{ ansible_user }}"
|
||||
groups:
|
||||
- docker
|
||||
append: yes
|
||||
|
||||
- name: Start docker service
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
become: yes
|
||||
|
||||
- name: Pull origin images
|
||||
command: "docker pull docker.io/openshift/{{ item }}:{{ origin_version }}"
|
||||
with_items:
|
||||
- origin-web-console
|
||||
- origin-docker-registry
|
||||
- origin-haproxy-router
|
||||
- origin-deployer
|
||||
- origin-pod
|
||||
- origin
|
||||
become: yes
|
||||
|
||||
- name: Set group ownership of docker socket
|
||||
become: true
|
||||
file:
|
||||
path: /var/run/docker.sock
|
||||
group: docker
|
||||
|
||||
- name: Reset ssh connection to pick up docker group
|
||||
meta: reset_connection
|
||||
- name: Include ensure-openshift
|
||||
include_role:
|
||||
name: ensure-openshift
|
||||
|
@ -1,7 +1,7 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- role: clear-firewall
|
||||
- role: install-openshift
|
||||
- role: ensure-openshift
|
||||
- role: use-buildset-registry
|
||||
buildset_registry_docker_user: root
|
||||
- role: deploy-openshift
|
||||
|
@ -210,7 +210,7 @@
|
||||
- roles/pull-from-intermediate-registry/.*
|
||||
- roles/push-to-intermediate-registry/.*
|
||||
- roles/ensure-docker/.*
|
||||
- roles/install-openshift/.*
|
||||
- roles/ensure-openshift/.*
|
||||
- roles/build-docker-image/.*
|
||||
- roles/run-buildset-registry/.*
|
||||
- roles/use-buildset-registry/.*
|
||||
|
Loading…
Reference in New Issue
Block a user