summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/README.md19
-rw-r--r--playbooks/adhoc/README.md5
-rw-r--r--playbooks/aws/README.md4
-rw-r--r--playbooks/byo/README.md11
-rw-r--r--playbooks/byo/openshift-cluster/openshift-logging.yml35
-rw-r--r--playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml2
-rw-r--r--playbooks/byo/openshift-preflight/README.md43
-rw-r--r--playbooks/byo/openshift-preflight/check.yml31
-rw-r--r--playbooks/common/README.md9
-rw-r--r--playbooks/common/openshift-cluster/openshift_logging.yml5
-rw-r--r--playbooks/common/openshift-cluster/openshift_metrics.yml5
-rw-r--r--playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml6
-rw-r--r--playbooks/common/openshift-cluster/upgrades/etcd/backup.yml3
-rw-r--r--playbooks/common/openshift-cluster/upgrades/pre/verify_docker_upgrade_targets.yml4
-rw-r--r--playbooks/gce/README.md4
-rw-r--r--playbooks/libvirt/README.md4
-rw-r--r--playbooks/openstack/README.md4
17 files changed, 186 insertions, 8 deletions
diff --git a/playbooks/README.md b/playbooks/README.md
new file mode 100644
index 000000000..5857a9f59
--- /dev/null
+++ b/playbooks/README.md
@@ -0,0 +1,19 @@
+# openshift-ansible playbooks
+
+In summary:
+
+- [`byo`](byo) (_Bring Your Own_ hosts) has the most actively maintained
+ playbooks for installing, upgrading and performing others tasks on OpenShift
+ clusters.
+- [`common`](common) has a set of playbooks that are included by playbooks in
+ `byo` and others.
+
+And:
+
+- [`adhoc`](adhoc) is a generic home for playbooks and tasks that are community
+ supported and not officially maintained.
+- [`aws`](aws), [`gce`](gce), [`libvirt`](libvirt) and [`openstack`](openstack)
+ are related to the [`bin/cluster`](../bin) tool and its usage is deprecated.
+
+Refer to the `README.md` file in each playbook directory for more information
+about them.
diff --git a/playbooks/adhoc/README.md b/playbooks/adhoc/README.md
new file mode 100644
index 000000000..69b9d3135
--- /dev/null
+++ b/playbooks/adhoc/README.md
@@ -0,0 +1,5 @@
+# _Ad hoc_ playbooks
+
+This directory holds playbooks and tasks that really don't have a better home.
+Existing playbooks living here are community supported and not officially
+maintained.
diff --git a/playbooks/aws/README.md b/playbooks/aws/README.md
new file mode 100644
index 000000000..99698b4d0
--- /dev/null
+++ b/playbooks/aws/README.md
@@ -0,0 +1,4 @@
+# AWS playbooks
+
+This playbook directory is meant to be driven by [`bin/cluster`](../../bin),
+which is community supported and most use is considered deprecated.
diff --git a/playbooks/byo/README.md b/playbooks/byo/README.md
new file mode 100644
index 000000000..460fd7cf6
--- /dev/null
+++ b/playbooks/byo/README.md
@@ -0,0 +1,11 @@
+# Bring Your Own hosts playbooks
+
+This directory has the most actively used, maintained and supported set of
+playbooks for installing, upgrading and performing others tasks on OpenShift
+clusters.
+
+Usage is documented in the official OpenShift documentation pages, under the
+Advanced Installation topic:
+
+- [OpenShift Origin: Advanced Installation](https://docs.openshift.org/latest/install_config/install/advanced_install.html)
+- [OpenShift Container Platform: Advanced Installation](https://docs.openshift.com/container-platform/latest/install_config/install/advanced_install.html)
diff --git a/playbooks/byo/openshift-cluster/openshift-logging.yml b/playbooks/byo/openshift-cluster/openshift-logging.yml
new file mode 100644
index 000000000..09ab91bbd
--- /dev/null
+++ b/playbooks/byo/openshift-cluster/openshift-logging.yml
@@ -0,0 +1,35 @@
+---
+#
+# This playbook is a preview of upcoming changes for installing
+# Hosted logging on. See inventory/byo/hosts.*.example for the
+# currently supported method.
+#
+- include: ../../common/openshift-cluster/verify_ansible_version.yml
+
+- name: Create initial host groups for localhost
+ hosts: localhost
+ connection: local
+ become: no
+ gather_facts: no
+ tags:
+ - always
+ tasks:
+ - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
+ - add_host:
+ name: "{{ item }}"
+ groups: l_oo_all_hosts
+ with_items: "{{ g_all_hosts | default([]) }}"
+
+- name: Create initial host groups for all hosts
+ hosts: l_oo_all_hosts
+ gather_facts: no
+ tags:
+ - always
+ tasks:
+ - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
+
+- include: ../../common/openshift-cluster/openshift_logging.yml
+ vars:
+ openshift_cluster_id: "{{ cluster_id | default('default') }}"
+ openshift_debug_level: "{{ debug_level | default(2) }}"
+ openshift_deployment_type: "{{ deployment_type }}"
diff --git a/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
index 561be7859..d337b6f75 100644
--- a/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
+++ b/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
@@ -1,7 +1,5 @@
---
# Playbook to upgrade Docker to the max allowable version for an OpenShift cluster.
-#
-# Currently only supports upgrading 1.9.x to >= 1.10.x.
- hosts: localhost
connection: local
become: no
diff --git a/playbooks/byo/openshift-preflight/README.md b/playbooks/byo/openshift-preflight/README.md
new file mode 100644
index 000000000..b50292eac
--- /dev/null
+++ b/playbooks/byo/openshift-preflight/README.md
@@ -0,0 +1,43 @@
+# OpenShift preflight checks
+
+Here we provide an Ansible playbook for detecting potential roadblocks prior to
+an install or upgrade.
+
+Ansible's default operation mode is to fail fast, on the first error. However,
+when performing checks, it is useful to gather as much information about
+problems as possible in a single run.
+
+The `check.yml` playbook runs a battery of checks against the inventory hosts
+and tells Ansible to ignore intermediate errors, thus giving a more complete
+diagnostic of the state of each host. Still, if any check failed, the playbook
+run will be marked as having failed.
+
+To facilitate understanding the problems that were encountered, we provide a
+custom callback plugin to summarize execution errors at the end of a playbook
+run.
+
+---
+
+*Note that currently the `check.yml` playbook is only useful for RPM-based
+installations. Containerized installs are excluded from checks for now, but
+might be included in the future if there is demand for that.*
+
+---
+
+## Running
+
+With an installation of Ansible 2.2 or greater, run the playbook directly
+against your inventory file. Here is the step-by-step:
+
+1. If you haven't done it yet, clone this repository:
+
+ ```console
+ $ git clone https://github.com/openshift/openshift-ansible
+ $ cd openshift-ansible
+ ```
+
+2. Run the playbook:
+
+ ```console
+ $ ansible-playbook -i <inventory file> playbooks/byo/openshift-preflight/check.yml
+ ```
diff --git a/playbooks/byo/openshift-preflight/check.yml b/playbooks/byo/openshift-preflight/check.yml
new file mode 100644
index 000000000..32673d01d
--- /dev/null
+++ b/playbooks/byo/openshift-preflight/check.yml
@@ -0,0 +1,31 @@
+---
+- hosts: OSEv3
+ roles:
+ - openshift_preflight/init
+
+- hosts: OSEv3
+ name: checks that apply to all hosts
+ gather_facts: no
+ ignore_errors: yes
+ roles:
+ - openshift_preflight/common
+
+- hosts: masters
+ name: checks that apply to masters
+ gather_facts: no
+ ignore_errors: yes
+ roles:
+ - openshift_preflight/masters
+
+- hosts: nodes
+ name: checks that apply to nodes
+ gather_facts: no
+ ignore_errors: yes
+ roles:
+ - openshift_preflight/nodes
+
+- hosts: OSEv3
+ name: verify check results
+ gather_facts: no
+ roles:
+ - openshift_preflight/verify_status
diff --git a/playbooks/common/README.md b/playbooks/common/README.md
new file mode 100644
index 000000000..0b5e26989
--- /dev/null
+++ b/playbooks/common/README.md
@@ -0,0 +1,9 @@
+# Common playbooks
+
+This directory has a generic set of playbooks that are included by playbooks in
+[`byo`](../byo), as well as other playbooks related to the
+[`bin/cluster`](../../bin) tool.
+
+Note: playbooks in this directory use generic group names that do not line up
+with the groups used by the `byo` playbooks or `bin/cluster` derived playbooks,
+requiring an explicit remapping of groups.
diff --git a/playbooks/common/openshift-cluster/openshift_logging.yml b/playbooks/common/openshift-cluster/openshift_logging.yml
new file mode 100644
index 000000000..6347cbc26
--- /dev/null
+++ b/playbooks/common/openshift-cluster/openshift_logging.yml
@@ -0,0 +1,5 @@
+---
+- name: OpenShift Aggregated Logging
+ hosts: oo_first_master
+ roles:
+ - openshift_logging
diff --git a/playbooks/common/openshift-cluster/openshift_metrics.yml b/playbooks/common/openshift-cluster/openshift_metrics.yml
new file mode 100644
index 000000000..9f38ceea6
--- /dev/null
+++ b/playbooks/common/openshift-cluster/openshift_metrics.yml
@@ -0,0 +1,5 @@
+---
+- name: OpenShift Metrics
+ hosts: oo_first_master
+ roles:
+ - openshift_metrics
diff --git a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml
index e3379f29b..b2a2eac9a 100644
--- a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml
+++ b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml
@@ -30,9 +30,9 @@
changed_when: false
- fail:
- msg: This playbook requires access to Docker 1.10 or later
- # Disable the 1.10 requirement if the user set a specific Docker version
- when: docker_version is not defined and (docker_upgrade is not defined or docker_upgrade | bool == True) and (pkg_check.rc == 0 and (avail_docker_version.stdout == "" or avail_docker_version.stdout | version_compare('1.10','<')))
+ msg: This playbook requires access to Docker 1.12 or later
+ # Disable the 1.12 requirement if the user set a specific Docker version
+ when: docker_version is not defined and (docker_upgrade is not defined or docker_upgrade | bool == True) and (pkg_check.rc == 0 and (avail_docker_version.stdout == "" or avail_docker_version.stdout | version_compare('1.12','<')))
# Default l_docker_upgrade to False, we'll set to True if an upgrade is required:
- set_fact:
diff --git a/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml b/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml
index be42f005f..d0eadf1fc 100644
--- a/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml
+++ b/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml
@@ -4,6 +4,7 @@
vars:
embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
timestamp: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"
+ etcdctl_command: "{{ 'etcdctl' if not openshift.common.is_containerized or embedded_etcd else 'docker exec etcd_container etcdctl' }}"
roles:
- openshift_facts
tasks:
@@ -67,7 +68,7 @@
- name: Generate etcd backup
command: >
- etcdctl backup --data-dir={{ openshift.etcd.etcd_data_dir }}
+ {{ etcdctl_command }} backup --data-dir={{ openshift.etcd.etcd_data_dir }}
--backup-dir={{ openshift.common.data_dir }}/etcd-backup-{{ backup_tag | default('') }}{{ timestamp }}
- set_fact:
diff --git a/playbooks/common/openshift-cluster/upgrades/pre/verify_docker_upgrade_targets.yml b/playbooks/common/openshift-cluster/upgrades/pre/verify_docker_upgrade_targets.yml
index ba4d77617..7646e0fa6 100644
--- a/playbooks/common/openshift-cluster/upgrades/pre/verify_docker_upgrade_targets.yml
+++ b/playbooks/common/openshift-cluster/upgrades/pre/verify_docker_upgrade_targets.yml
@@ -19,5 +19,5 @@
when: openshift.common.is_atomic | bool
- fail:
- msg: This playbook requires access to Docker 1.10 or later
- when: openshift.common.is_atomic | bool and l_docker_version.avail_version | default(l_docker_version.curr_version, true) | version_compare('1.10','<')
+ msg: This playbook requires access to Docker 1.12 or later
+ when: openshift.common.is_atomic | bool and l_docker_version.avail_version | default(l_docker_version.curr_version, true) | version_compare('1.12','<')
diff --git a/playbooks/gce/README.md b/playbooks/gce/README.md
new file mode 100644
index 000000000..0514d6f50
--- /dev/null
+++ b/playbooks/gce/README.md
@@ -0,0 +1,4 @@
+# GCE playbooks
+
+This playbook directory is meant to be driven by [`bin/cluster`](../../bin),
+which is community supported and most use is considered deprecated.
diff --git a/playbooks/libvirt/README.md b/playbooks/libvirt/README.md
new file mode 100644
index 000000000..3ce46a76f
--- /dev/null
+++ b/playbooks/libvirt/README.md
@@ -0,0 +1,4 @@
+# libvirt playbooks
+
+This playbook directory is meant to be driven by [`bin/cluster`](../../bin),
+which is community supported and most use is considered deprecated.
diff --git a/playbooks/openstack/README.md b/playbooks/openstack/README.md
new file mode 100644
index 000000000..a6d8d6995
--- /dev/null
+++ b/playbooks/openstack/README.md
@@ -0,0 +1,4 @@
+# OpenStack playbooks
+
+This playbook directory is meant to be driven by [`bin/cluster`](../../bin),
+which is community supported and most use is considered deprecated.