From 1b4526d677651cb3677cbf7cc687a76fcba47c9a Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 27 Apr 2015 15:04:57 -0700 Subject: [WIP] Infrastructure - Deploy services in cluster * Create OpenShift Docker Registry * Create OpenShift router --- playbooks/gce/openshift-cluster/launch.yml | 15 ++++++++ playbooks/gce/openshift-cluster/list.yml | 2 +- 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_router/README.md | 41 ++++++++++++++++++++++ roles/openshift_router/handlers/main.yml | 0 roles/openshift_router/meta/main.yml | 13 +++++++ roles/openshift_router/tasks/main.yml | 8 +++++ roles/openshift_router/vars/main.yml | 2 ++ 12 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 roles/openshift_docker_registry/README.md create mode 100644 roles/openshift_docker_registry/handlers/main.yml create mode 100644 roles/openshift_docker_registry/meta/main.yml create mode 100644 roles/openshift_docker_registry/tasks/main.yml create mode 100644 roles/openshift_docker_registry/vars/main.yml create mode 100644 roles/openshift_router/README.md create mode 100644 roles/openshift_router/handlers/main.yml create mode 100644 roles/openshift_router/meta/main.yml create mode 100644 roles/openshift_router/tasks/main.yml create mode 100644 roles/openshift_router/vars/main.yml diff --git a/playbooks/gce/openshift-cluster/launch.yml b/playbooks/gce/openshift-cluster/launch.yml index 771f51e91..36fc430aa 100644 --- a/playbooks/gce/openshift-cluster/launch.yml +++ b/playbooks/gce/openshift-cluster/launch.yml @@ -23,6 +23,21 @@ cluster: "{{ cluster_id }}" type: "{{ k8s_type }}" + - set_fact: + oo_first_master: "{{ item }}" + with_items: master_names.split() + - debug: var=oo_first_master + - include: update.yml +- name: Deploy OpenShift Services + hosts: oo_first_master + connection: ssh + gather_facts: yes + vars_files: + - vars.yml + roles: + - openshift_docker_registry + - openshift_router + - include: list.yml diff --git a/playbooks/gce/openshift-cluster/list.yml b/playbooks/gce/openshift-cluster/list.yml index 962381306..5ba0f5a48 100644 --- a/playbooks/gce/openshift-cluster/list.yml +++ b/playbooks/gce/openshift-cluster/list.yml @@ -16,7 +16,7 @@ ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated) -- name: List Hosts +- name: List instance(s) hosts: oo_list_hosts gather_facts: no tasks: diff --git a/roles/openshift_docker_registry/README.md b/roles/openshift_docker_registry/README.md new file mode 100644 index 000000000..202c818b8 --- /dev/null +++ b/roles/openshift_docker_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_docker_registry/handlers/main.yml b/roles/openshift_docker_registry/handlers/main.yml new file mode 100644 index 000000000..e69de29bb diff --git a/roles/openshift_docker_registry/meta/main.yml b/roles/openshift_docker_registry/meta/main.yml new file mode 100644 index 000000000..93b6797d1 --- /dev/null +++ b/roles/openshift_docker_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_docker_registry/tasks/main.yml b/roles/openshift_docker_registry/tasks/main.yml new file mode 100644 index 000000000..18b256032 --- /dev/null +++ b/roles/openshift_docker_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 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 new file mode 100644 index 000000000..cd21505a4 --- /dev/null +++ b/roles/openshift_docker_registry/vars/main.yml @@ -0,0 +1,2 @@ +--- + diff --git a/roles/openshift_router/README.md b/roles/openshift_router/README.md new file mode 100644 index 000000000..6d8ee25c6 --- /dev/null +++ b/roles/openshift_router/README.md @@ -0,0 +1,41 @@ +OpenShift Container Router +========================== + +OpenShift Router 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_router/handlers/main.yml b/roles/openshift_router/handlers/main.yml new file mode 100644 index 000000000..e69de29bb diff --git a/roles/openshift_router/meta/main.yml b/roles/openshift_router/meta/main.yml new file mode 100644 index 000000000..0471e5e14 --- /dev/null +++ b/roles/openshift_router/meta/main.yml @@ -0,0 +1,13 @@ +--- +galaxy_info: + author: OpenShift Red Hat + description: OpenShift Embedded Router + 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_router/tasks/main.yml b/roles/openshift_router/tasks/main.yml new file mode 100644 index 000000000..56dbcc414 --- /dev/null +++ b/roles/openshift_router/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 Router + command: openshift ex router --create --credentials="{{ansible_env['HOME']}}"/.config/openshift/config {{ _option_images|default() }} + register: _openshift_router__results + changed_when: "'service exists' not in _openshift_router__results.stdout" diff --git a/roles/openshift_router/vars/main.yml b/roles/openshift_router/vars/main.yml new file mode 100644 index 000000000..cd21505a4 --- /dev/null +++ b/roles/openshift_router/vars/main.yml @@ -0,0 +1,2 @@ +--- + -- cgit v1.2.3