From 3e533e199aa9262f5ca45f8311e82e975cde73b9 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 1 May 2015 13:57:30 -0700 Subject: * Deploy services from common playbook --- playbooks/aws/openshift-cluster/launch.yml | 8 +++++ .../common/openshift-cluster/create_services.yml | 14 ++++++++ playbooks/gce/openshift-cluster/launch.yml | 15 ++++---- roles/openshift_docker_registry/README.md | 42 ---------------------- roles/openshift_docker_registry/handlers/main.yml | 0 roles/openshift_docker_registry/meta/main.yml | 13 ------- roles/openshift_docker_registry/tasks/main.yml | 8 ----- roles/openshift_docker_registry/vars/main.yml | 2 -- roles/openshift_registry/README.md | 42 ++++++++++++++++++++++ roles/openshift_registry/handlers/main.yml | 0 roles/openshift_registry/meta/main.yml | 13 +++++++ roles/openshift_registry/tasks/main.yml | 8 +++++ roles/openshift_registry/vars/main.yml | 2 ++ roles/openshift_router/tasks/main.yml | 2 +- 14 files changed, 96 insertions(+), 73 deletions(-) create mode 100644 playbooks/common/openshift-cluster/create_services.yml delete mode 100644 roles/openshift_docker_registry/README.md delete mode 100644 roles/openshift_docker_registry/handlers/main.yml delete mode 100644 roles/openshift_docker_registry/meta/main.yml delete mode 100644 roles/openshift_docker_registry/tasks/main.yml delete mode 100644 roles/openshift_docker_registry/vars/main.yml create mode 100644 roles/openshift_registry/README.md create mode 100644 roles/openshift_registry/handlers/main.yml create mode 100644 roles/openshift_registry/meta/main.yml create mode 100644 roles/openshift_registry/tasks/main.yml create mode 100644 roles/openshift_registry/vars/main.yml diff --git a/playbooks/aws/openshift-cluster/launch.yml b/playbooks/aws/openshift-cluster/launch.yml index 3eb5496e4..f64925124 100644 --- a/playbooks/aws/openshift-cluster/launch.yml +++ b/playbooks/aws/openshift-cluster/launch.yml @@ -25,6 +25,14 @@ cluster: "{{ cluster_id }}" type: "{{ k8s_type }}" + - set_fact: + a_master: "{{ master_names[0] }}" + - add_host: name={{ a_master }} groups=service_master + - include: update.yml +- include: ../../common/openshift-cluster/create_services.yml + vars: + create_services__master: "{{ service_master }}" + - include: list.yml diff --git a/playbooks/common/openshift-cluster/create_services.yml b/playbooks/common/openshift-cluster/create_services.yml new file mode 100644 index 000000000..c85db5234 --- /dev/null +++ b/playbooks/common/openshift-cluster/create_services.yml @@ -0,0 +1,14 @@ +--- +- name: Debug Deploy OpenShift Services + hosts: localhost + gather_facts: no + tasks: + - debug: var=create_services__master + +- name: Deploy OpenShift Services + hosts: "{{ create_services__master }}" + connection: ssh + gather_facts: yes + roles: + - openshift_registry + - openshift_router diff --git a/playbooks/gce/openshift-cluster/launch.yml b/playbooks/gce/openshift-cluster/launch.yml index 36fc430aa..53d461183 100644 --- a/playbooks/gce/openshift-cluster/launch.yml +++ b/playbooks/gce/openshift-cluster/launch.yml @@ -24,20 +24,21 @@ type: "{{ k8s_type }}" - set_fact: - oo_first_master: "{{ item }}" - with_items: master_names.split() - - debug: var=oo_first_master + a_master: "{{ master_names[0] }}" + - add_host: name={{ a_master }} groups=service_master - include: update.yml - name: Deploy OpenShift Services - hosts: oo_first_master + hosts: service_master connection: ssh gather_facts: yes - vars_files: - - vars.yml roles: - - openshift_docker_registry + - openshift_registry - openshift_router +- include: ../../common/openshift-cluster/create_services.yml + vars: + create_services__master: "{{ service_master }}" + - include: list.yml diff --git a/roles/openshift_docker_registry/README.md b/roles/openshift_docker_registry/README.md deleted file mode 100644 index 202c818b8..000000000 --- a/roles/openshift_docker_registry/README.md +++ /dev/null @@ -1,42 +0,0 @@ -OpenShift Container Docker Registry -=================================== - -OpenShift Docker Registry service installation - -Requirements ------------- - -Running OpenShift cluster - -Role Variables --------------- - -From this role: -| Name | Default value | | -|--------------------|-------------------------------------------------------|---------------------| -| | | | - -From openshift_common: -| Name | Default value | | -|-----------------------|---------------|--------------------------------------| -| openshift_debug_level | 0 | Global openshift debug log verbosity | - - -Dependencies ------------- - -Example Playbook ----------------- - -TODO - -License -------- - -Apache License, Version 2.0 - -Author Information ------------------- - -Red Hat openshift@redhat.com - diff --git a/roles/openshift_docker_registry/handlers/main.yml b/roles/openshift_docker_registry/handlers/main.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/openshift_docker_registry/meta/main.yml b/roles/openshift_docker_registry/meta/main.yml deleted file mode 100644 index 93b6797d1..000000000 --- a/roles/openshift_docker_registry/meta/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -galaxy_info: - author: OpenShift Red Hat - description: OpenShift Embedded Docker Registry - company: Red Hat, Inc. - license: Apache License, Version 2.0 - min_ansible_version: 1.7 - platforms: - - name: EL - versions: - - 7 - categories: - - cloud diff --git a/roles/openshift_docker_registry/tasks/main.yml b/roles/openshift_docker_registry/tasks/main.yml deleted file mode 100644 index 18b256032..000000000 --- a/roles/openshift_docker_registry/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- set_fact: _option_images="--images={{ openshift_registry_url|quote }}" - when: openshift_registry_url is defined - -- name: Deploy OpenShift Docker Registry - command: openshift admin registry --create --credentials="{{ansible_env['HOME']}}"/.config/openshift/config {{ _option_images|default() }} - register: _openshift_docker_registry__results - changed_when: "'service exists' not in _openshift_docker_registry__results.stdout" diff --git a/roles/openshift_docker_registry/vars/main.yml b/roles/openshift_docker_registry/vars/main.yml deleted file mode 100644 index cd21505a4..000000000 --- a/roles/openshift_docker_registry/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- - diff --git a/roles/openshift_registry/README.md b/roles/openshift_registry/README.md new file mode 100644 index 000000000..202c818b8 --- /dev/null +++ b/roles/openshift_registry/README.md @@ -0,0 +1,42 @@ +OpenShift Container Docker Registry +=================================== + +OpenShift Docker Registry service installation + +Requirements +------------ + +Running OpenShift cluster + +Role Variables +-------------- + +From this role: +| Name | Default value | | +|--------------------|-------------------------------------------------------|---------------------| +| | | | + +From openshift_common: +| Name | Default value | | +|-----------------------|---------------|--------------------------------------| +| openshift_debug_level | 0 | Global openshift debug log verbosity | + + +Dependencies +------------ + +Example Playbook +---------------- + +TODO + +License +------- + +Apache License, Version 2.0 + +Author Information +------------------ + +Red Hat openshift@redhat.com + diff --git a/roles/openshift_registry/handlers/main.yml b/roles/openshift_registry/handlers/main.yml new file mode 100644 index 000000000..e69de29bb diff --git a/roles/openshift_registry/meta/main.yml b/roles/openshift_registry/meta/main.yml new file mode 100644 index 000000000..93b6797d1 --- /dev/null +++ b/roles/openshift_registry/meta/main.yml @@ -0,0 +1,13 @@ +--- +galaxy_info: + author: OpenShift Red Hat + description: OpenShift Embedded Docker Registry + company: Red Hat, Inc. + license: Apache License, Version 2.0 + min_ansible_version: 1.7 + platforms: + - name: EL + versions: + - 7 + categories: + - cloud diff --git a/roles/openshift_registry/tasks/main.yml b/roles/openshift_registry/tasks/main.yml new file mode 100644 index 000000000..ea362bb7d --- /dev/null +++ b/roles/openshift_registry/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- set_fact: _option_images="--images={{ openshift_registry_url|quote }}" + when: openshift_registry_url is defined + +- name: Deploy OpenShift Registry + command: openshift admin registry --create --credentials=/var/lib/openshift/openshift.local.certificates/openshift-registry/.kubeconfig {{ _option_images|default() }} + register: _openshift_registry__results + changed_when: "'service exists' not in _openshift_registry__results.stdout" diff --git a/roles/openshift_registry/vars/main.yml b/roles/openshift_registry/vars/main.yml new file mode 100644 index 000000000..cd21505a4 --- /dev/null +++ b/roles/openshift_registry/vars/main.yml @@ -0,0 +1,2 @@ +--- + diff --git a/roles/openshift_router/tasks/main.yml b/roles/openshift_router/tasks/main.yml index 56dbcc414..ae52063cb 100644 --- a/roles/openshift_router/tasks/main.yml +++ b/roles/openshift_router/tasks/main.yml @@ -3,6 +3,6 @@ when: openshift_registry_url is defined - name: Deploy OpenShift Router - command: openshift ex router --create --credentials="{{ansible_env['HOME']}}"/.config/openshift/config {{ _option_images|default() }} + command: openshift ex router --create --credentials=/var/lib/openshift/openshift.local.certificates/openshift-router/.kubeconfig {{ _option_images|default() }} register: _openshift_router__results changed_when: "'service exists' not in _openshift_router__results.stdout" -- cgit v1.2.3