import required subset of upstream openshift-ansible roles/playbooks for OpenShift/OSBS

This commit is contained in:
Adam Miller 2015-08-05 15:59:05 +00:00
parent 1b4501657f
commit c8f12a9938
118 changed files with 22176 additions and 0 deletions

View file

@ -0,0 +1,34 @@
OpenShift Master Cluster
========================
TODO
Requirements
------------
TODO
Role Variables
--------------
TODO
Dependencies
------------
TODO
Example Playbook
----------------
TODO
License
-------
Apache License Version 2.0
Author Information
------------------
Jason DeTiberus (jdetiber@redhat.com)

View file

@ -0,0 +1,16 @@
---
galaxy_info:
author: Jason DeTiberus
description:
company: Red Hat, Inc.
license: Apache License, Version 2.0
min_ansible_version: 1.8
platforms:
- name: EL
versions:
- 7
categories:
- cloud
- system
dependencies:
- { role: openshift_repos }

View file

@ -0,0 +1,44 @@
---
- fail:
msg: This role requires that openshift_master_cluster_vip is set
when: openshift_master_cluster_vip is not defined or not openshift_master_cluster_vip
- fail:
msg: This role requires that openshift_master_cluster_public_vip is set
when: openshift_master_cluster_public_vip is not defined or not openshift_master_cluster_public_vip
- name: Authenticate to the cluster
command: pcs cluster auth -u hacluster -p {{ openshift_master_cluster_password }} {{ omc_cluster_hosts }}
- name: Create the cluster
command: pcs cluster setup --name openshift_master {{ omc_cluster_hosts }}
- name: Start the cluster
command: pcs cluster start --all
- name: Enable the cluster on all nodes
command: pcs cluster enable --all
- name: Set default resource stickiness
command: pcs resource defaults resource-stickiness=100
- name: Add the cluster VIP resource
command: pcs resource create virtual-ip IPaddr2 ip={{ openshift_master_cluster_vip }} --group openshift-master
- name: Add the cluster public VIP resource
command: pcs resource create virtual-ip IPaddr2 ip={{ openshift_master_cluster_public_vip }} --group openshift-master
when: openshift_master_cluster_public_vip != openshift_master_cluster_vip
- name: Add the cluster openshift-master service resource
command: pcs resource create master systemd:openshift-master op start timeout=90s stop timeout=90s --group openshift-master
- name: Disable stonith
command: pcs property set stonith-enabled=false
# TODO: handle case where api port is not 8443
- name: Wait for the clustered master service to be available
wait_for:
host: "{{ openshift_master_cluster_vip }}"
port: 8443
state: started
timeout: 180
delay: 90

View file

@ -0,0 +1,8 @@
---
- debug: msg="Deferring config"
- name: Start and enable openshift-master
service:
name: openshift-master
state: started
enabled: yes

View file

@ -0,0 +1,13 @@
---
- name: Test if cluster is already configured
command: pcs status
register: pcs_status
changed_when: false
failed_when: false
when: not openshift.master.cluster_defer_ha | bool
- include: configure.yml
when: "pcs_status | failed and 'Error: cluster is not currently running on this node' in pcs_status.stderr"
- include: configure_deferred.yml
when: openshift.master.cluster_defer_ha | bool