summaryrefslogtreecommitdiffstats
path: root/roles/openshift_common
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_common')
-rw-r--r--roles/openshift_common/README.md42
-rw-r--r--roles/openshift_common/defaults/main.yml8
-rw-r--r--roles/openshift_common/meta/main.yml15
-rw-r--r--roles/openshift_common/tasks/main.yml21
-rw-r--r--roles/openshift_common/tasks/set_facts.yml9
-rw-r--r--roles/openshift_common/vars/main.yml6
6 files changed, 101 insertions, 0 deletions
diff --git a/roles/openshift_common/README.md b/roles/openshift_common/README.md
new file mode 100644
index 000000000..c2ae609ff
--- /dev/null
+++ b/roles/openshift_common/README.md
@@ -0,0 +1,42 @@
+OpenShift Common
+================
+
+OpenShift common installation and configuration tasks.
+
+Requirements
+------------
+
+A RHEL 7.1 host pre-configured with access to the rhel-7-server-rpms,
+rhel-7-server-extra-rpms, and rhel-7-server-ose-beta-rpms repos.
+
+Role Variables
+--------------
+
+| Name | Default value | |
+|-------------------------------|------------------------------|----------------------------------------|
+| openshift_bind_ip | ansible_default_ipv4.address | IP to use for local binding |
+| openshift_debug_level | 0 | Global openshift debug log verbosity |
+| openshift_hostname_workaround | True | Workaround needed to set hostname to IP address |
+| openshift_hostname | openshift_public_ip if openshift_hostname_workaround else ansible_fqdn | hostname to use for this instance |
+| openshift_public_ip | UNDEF (Required) | Public IP address to use for this host |
+| openshift_env | default | Envrionment name if multiple OpenShift instances |
+
+Dependencies
+------------
+
+os_firewall
+
+Example Playbook
+----------------
+
+TODO
+
+License
+-------
+
+Apache License, Version 2.0
+
+Author Information
+------------------
+
+TODO
diff --git a/roles/openshift_common/defaults/main.yml b/roles/openshift_common/defaults/main.yml
new file mode 100644
index 000000000..a541591fb
--- /dev/null
+++ b/roles/openshift_common/defaults/main.yml
@@ -0,0 +1,8 @@
+---
+openshift_bind_ip: "{{ ansible_default_ipv4.address }}"
+openshift_debug_level: 0
+
+# TODO: Once openshift stops resolving hostnames for node queries remove
+# this...
+openshift_hostname_workaround: true
+openshift_hostname: "{{ openshift_public_ip if openshift_hostname_workaround else ansible_fqdn }}"
diff --git a/roles/openshift_common/meta/main.yml b/roles/openshift_common/meta/main.yml
new file mode 100644
index 000000000..88b7677d0
--- /dev/null
+++ b/roles/openshift_common/meta/main.yml
@@ -0,0 +1,15 @@
+---
+galaxy_info:
+ author: Jason DeTiberus
+ description: OpenShift Common
+ company: Red Hat, Inc.
+ license: Apache License, Version 2.0
+ min_ansible_version: 1.7
+ platforms:
+ - name: EL
+ versions:
+ - 7
+ categories:
+ - cloud
+dependencies:
+- { role: os_firewall }
diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml
new file mode 100644
index 000000000..728bba4e4
--- /dev/null
+++ b/roles/openshift_common/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+# fixme: Once openshift stops resolving hostnames for node queries remove this...
+- name: Set hostname to IP Addr (WORKAROUND)
+ hostname: name={{ openshift_bind_ip }}
+ when: openshift_hostname_workaround
+
+- name: Configure local facts file
+ file: path=/etc/ansible/facts.d/ state=directory mode=0750
+
+- name: Set common OpenShift facts
+ include: set_facts.yml
+ facts:
+ - section: common
+ option: env
+ value: "{{ openshift_env | default('default') }}"
+ - section: common
+ option: host_type
+ value: "{{ openshift_host_type }}"
+ - section: common
+ option: debug_level
+ value: "{{ openshift_debug_level }}"
diff --git a/roles/openshift_common/tasks/set_facts.yml b/roles/openshift_common/tasks/set_facts.yml
new file mode 100644
index 000000000..349eecd1d
--- /dev/null
+++ b/roles/openshift_common/tasks/set_facts.yml
@@ -0,0 +1,9 @@
+---
+- name: "Setting local_facts"
+ ini_file:
+ dest: /etc/ansible/facts.d/openshift.fact
+ mode: 0640
+ section: "{{ item.section }}"
+ option: "{{ item.option }}"
+ value: "{{ item.value }}"
+ with_items: facts
diff --git a/roles/openshift_common/vars/main.yml b/roles/openshift_common/vars/main.yml
new file mode 100644
index 000000000..623aed9bf
--- /dev/null
+++ b/roles/openshift_common/vars/main.yml
@@ -0,0 +1,6 @@
+---
+openshift_master_credentials_dir: /var/lib/openshift/openshift.local.certificates/admin/
+
+# TODO: Upstream kubernetes only supports iptables currently, if this changes,
+# then these variable should be moved to defaults
+os_firewall_use_firewalld: False