summaryrefslogtreecommitdiffstats
path: root/playbooks/common
diff options
context:
space:
mode:
authorWesley Hearn <wesley.s.hearn@gmail.com>2016-01-04 09:42:43 -0500
committerWesley Hearn <wesley.s.hearn@gmail.com>2016-01-04 09:42:43 -0500
commitf1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9 (patch)
tree1c304d5daebfb1780ca26973319b4427e2a40b54 /playbooks/common
parentfb1b9ff7d3293c821a8569ae95dcc8a98dfbf967 (diff)
parent0c18c742c60e5c4acd609d682caae7f7ce8840cd (diff)
downloadopenshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.tar.gz
openshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.tar.bz2
openshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.tar.xz
openshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.zip
Merge pull request #951 from abutcher/nfs
NFS for registry storage
Diffstat (limited to 'playbooks/common')
-rw-r--r--playbooks/common/openshift-cluster/config.yml2
-rw-r--r--playbooks/common/openshift-cluster/evaluate_groups.yml16
-rw-r--r--playbooks/common/openshift-master/config.yml10
-rw-r--r--playbooks/common/openshift-nfs/config.yml5
l---------playbooks/common/openshift-nfs/filter_plugins1
l---------playbooks/common/openshift-nfs/lookup_plugins1
l---------playbooks/common/openshift-nfs/roles1
-rw-r--r--playbooks/common/openshift-nfs/service.yml18
8 files changed, 53 insertions, 1 deletions
diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml
index a62d60167..11e5b68f6 100644
--- a/playbooks/common/openshift-cluster/config.yml
+++ b/playbooks/common/openshift-cluster/config.yml
@@ -5,6 +5,8 @@
- include: ../openshift-etcd/config.yml
+- include: ../openshift-nfs/config.yml
+
- include: ../openshift-master/config.yml
- include: ../openshift-node/config.yml
diff --git a/playbooks/common/openshift-cluster/evaluate_groups.yml b/playbooks/common/openshift-cluster/evaluate_groups.yml
index 6343a2567..db7105ed5 100644
--- a/playbooks/common/openshift-cluster/evaluate_groups.yml
+++ b/playbooks/common/openshift-cluster/evaluate_groups.yml
@@ -21,6 +21,14 @@
msg: This playbook requires g_lb_hosts to be set
when: g_lb_hosts is not defined
+ - fail:
+ msg: This playbook requires g_nfs_hosts to be set
+ when: g_nfs_hosts is not defined
+
+ - fail:
+ msg: The nfs group must be limited to one host
+ when: (groups[g_nfs_hosts] | default([])) | length > 1
+
- name: Evaluate oo_etcd_to_config
add_host:
name: "{{ item }}"
@@ -81,3 +89,11 @@
ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
ansible_sudo: "{{ g_sudo | default(omit) }}"
with_items: "{{ g_lb_hosts | default([]) }}"
+
+ - name: Evaluate oo_nfs_to_config
+ add_host:
+ name: "{{ item }}"
+ groups: oo_nfs_to_config
+ ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
+ ansible_sudo: "{{ g_sudo | default(omit) }}"
+ with_items: "{{ g_nfs_hosts | default([]) }}"
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index fae37d70c..759656e63 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -397,7 +397,15 @@
- name: Create services
hosts: oo_first_master
+ vars:
+ attach_registry_volume: "{{ groups.oo_nfs_to_config | length > 0 }}"
+ pre_tasks:
+ - set_fact:
+ nfs_host: "{{ groups.oo_nfs_to_config.0 }}"
+ registry_volume_path: "{{ hostvars[groups.oo_nfs_to_config.0].openshift.nfs.exports_dir + '/' + hostvars[groups.oo_nfs_to_config.0].openshift.nfs.registry_volume }}"
+ when: attach_registry_volume | bool
roles:
- role: openshift_router
when: openshift.master.infra_nodes is defined
- #- role: openshift_registry
+ - role: openshift_registry
+ when: openshift.master.infra_nodes is defined and attach_registry_volume | bool
diff --git a/playbooks/common/openshift-nfs/config.yml b/playbooks/common/openshift-nfs/config.yml
new file mode 100644
index 000000000..e3f5c17ca
--- /dev/null
+++ b/playbooks/common/openshift-nfs/config.yml
@@ -0,0 +1,5 @@
+---
+- name: Configure nfs hosts
+ hosts: oo_nfs_to_config
+ roles:
+ - role: openshift_storage_nfs
diff --git a/playbooks/common/openshift-nfs/filter_plugins b/playbooks/common/openshift-nfs/filter_plugins
new file mode 120000
index 000000000..99a95e4ca
--- /dev/null
+++ b/playbooks/common/openshift-nfs/filter_plugins
@@ -0,0 +1 @@
+../../../filter_plugins \ No newline at end of file
diff --git a/playbooks/common/openshift-nfs/lookup_plugins b/playbooks/common/openshift-nfs/lookup_plugins
new file mode 120000
index 000000000..ac79701db
--- /dev/null
+++ b/playbooks/common/openshift-nfs/lookup_plugins
@@ -0,0 +1 @@
+../../../lookup_plugins \ No newline at end of file
diff --git a/playbooks/common/openshift-nfs/roles b/playbooks/common/openshift-nfs/roles
new file mode 120000
index 000000000..e2b799b9d
--- /dev/null
+++ b/playbooks/common/openshift-nfs/roles
@@ -0,0 +1 @@
+../../../roles/ \ No newline at end of file
diff --git a/playbooks/common/openshift-nfs/service.yml b/playbooks/common/openshift-nfs/service.yml
new file mode 100644
index 000000000..20c8ca248
--- /dev/null
+++ b/playbooks/common/openshift-nfs/service.yml
@@ -0,0 +1,18 @@
+---
+- name: Populate g_service_nfs host group if needed
+ hosts: localhost
+ gather_facts: no
+ tasks:
+ - fail: msg="new_cluster_state is required to be injected in this playbook"
+ when: new_cluster_state is not defined
+
+ - name: Evaluate g_service_nfs
+ add_host: name={{ item }} groups=g_service_nfs
+ with_items: oo_host_group_exp | default([])
+
+- name: Change state on nfs instance(s)
+ hosts: g_service_nfs
+ connection: ssh
+ gather_facts: no
+ tasks:
+ - service: name=nfs-server state="{{ new_cluster_state }}"