From db570ca4fa92560e0ec1b90e1eabe6192f332c61 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 16 Oct 2015 11:33:28 -0400 Subject: Install storage plugin dependencies --- roles/openshift_node/tasks/main.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'roles/openshift_node/tasks') diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index 98271c8b3..036196d5e 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -39,6 +39,15 @@ yum: pkg={{ openshift.common.service_type }}-node{{ openshift_version }},tuned-profiles-{{ openshift.common.service_type }}-node{{ openshift_version }} state=present register: node_install_result +# TODO: allow for storage pre-requisites to be optional +- name: Install storage plugin pre-requisites + yum: + pkg: "{{ item }}" + state: installed + with_items: + - glusterfs-fuse + - ceph-common + - name: Install sdn-ovs package yum: pkg={{ openshift.common.service_type }}-sdn-ovs{{ openshift_version }} state=present register: sdn_install_result @@ -124,9 +133,15 @@ notify: - restart docker -- name: Allow NFS access for VMs - seboolean: name=virt_use_nfs state=yes persistent=yes +- name: Set sebooleans to allow storage plugin access from containers + seboolean: + name: "{{ item }}" + state: yes + persistent: yes when: ansible_selinux and ansible_selinux.status == "enabled" + with_items: + - virt_use_nfs + - virt_use_fusefs - name: Start and enable node service: name={{ openshift.common.service_type }}-node enabled=yes state=started -- cgit v1.2.3 From aff1356306adf8d02efe06ccbb322b68bef0995d Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 23 Oct 2015 14:08:40 -0400 Subject: make storage plugin dependency installation more flexible --- roles/openshift_node/tasks/main.yml | 21 +++------------------ roles/openshift_node/tasks/storage_plugins/ceph.yml | 5 +++++ .../tasks/storage_plugins/glusterfs.yml | 12 ++++++++++++ roles/openshift_node/tasks/storage_plugins/main.yml | 17 +++++++++++++++++ roles/openshift_node/tasks/storage_plugins/nfs.yml | 7 +++++++ 5 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 roles/openshift_node/tasks/storage_plugins/ceph.yml create mode 100644 roles/openshift_node/tasks/storage_plugins/glusterfs.yml create mode 100644 roles/openshift_node/tasks/storage_plugins/main.yml create mode 100644 roles/openshift_node/tasks/storage_plugins/nfs.yml (limited to 'roles/openshift_node/tasks') diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index 036196d5e..aea60b75c 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -32,6 +32,7 @@ schedulable: "{{ openshift_schedulable | default(openshift_scheduleable) | default(None) }}" docker_log_driver: "{{ lookup( 'oo_option' , 'docker_log_driver' ) | default('',True) }}" docker_log_options: "{{ lookup( 'oo_option' , 'docker_log_options' ) | default('',True) }}" + storage_plugin_deps: "{{ osn_storage_plugin_deps | default(None) }}" # We have to add tuned-profiles in the same transaction otherwise we run into depsolving # problems because the rpms don't pin the version properly. @@ -39,15 +40,6 @@ yum: pkg={{ openshift.common.service_type }}-node{{ openshift_version }},tuned-profiles-{{ openshift.common.service_type }}-node{{ openshift_version }} state=present register: node_install_result -# TODO: allow for storage pre-requisites to be optional -- name: Install storage plugin pre-requisites - yum: - pkg: "{{ item }}" - state: installed - with_items: - - glusterfs-fuse - - ceph-common - - name: Install sdn-ovs package yum: pkg={{ openshift.common.service_type }}-sdn-ovs{{ openshift_version }} state=present register: sdn_install_result @@ -133,15 +125,8 @@ notify: - restart docker -- name: Set sebooleans to allow storage plugin access from containers - seboolean: - name: "{{ item }}" - state: yes - persistent: yes - when: ansible_selinux and ansible_selinux.status == "enabled" - with_items: - - virt_use_nfs - - virt_use_fusefs +- name: Additional storage plugin configuration + include: storage_plugins/main.yml - name: Start and enable node service: name={{ openshift.common.service_type }}-node enabled=yes state=started diff --git a/roles/openshift_node/tasks/storage_plugins/ceph.yml b/roles/openshift_node/tasks/storage_plugins/ceph.yml new file mode 100644 index 000000000..b6936618a --- /dev/null +++ b/roles/openshift_node/tasks/storage_plugins/ceph.yml @@ -0,0 +1,5 @@ +--- +- name: Install Ceph storage plugin dependencies + yum: + pkg: ceph-common + state: installed diff --git a/roles/openshift_node/tasks/storage_plugins/glusterfs.yml b/roles/openshift_node/tasks/storage_plugins/glusterfs.yml new file mode 100644 index 000000000..b812e81df --- /dev/null +++ b/roles/openshift_node/tasks/storage_plugins/glusterfs.yml @@ -0,0 +1,12 @@ +--- +- name: Install GlusterFS storage plugin dependencies + yum: + pkg: glusterfs-fuse + state: installed + +- name: Set seboolean to allow gluster storage plugin access from containers + seboolean: + name: virt_use_fusefs + state: yes + persistent: yes + when: ansible_selinux and ansible_selinux.status == "enabled" diff --git a/roles/openshift_node/tasks/storage_plugins/main.yml b/roles/openshift_node/tasks/storage_plugins/main.yml new file mode 100644 index 000000000..042b38cd3 --- /dev/null +++ b/roles/openshift_node/tasks/storage_plugins/main.yml @@ -0,0 +1,17 @@ +--- +- pause: + +# The NFS storage plugin is always enabled since it doesn't require any +# additional package dependencies +- name: NFS storage plugin configuration + include: nfs.yml + +- name: GlusterFS storage plugin configuration + include: glusterfs.yml + when: "'glusterfs' in openshift.node.storage_plugin_deps" + +- name: Ceph storage plugin configuration + include: ceph.yml + when: "'ceph' in openshift.node.storage_plugin_deps" + +- pause: diff --git a/roles/openshift_node/tasks/storage_plugins/nfs.yml b/roles/openshift_node/tasks/storage_plugins/nfs.yml new file mode 100644 index 000000000..1edf21d9b --- /dev/null +++ b/roles/openshift_node/tasks/storage_plugins/nfs.yml @@ -0,0 +1,7 @@ +--- +- name: Set seboolean to allow nfs storage plugin access from containers + seboolean: + name: virt_use_nfs + state: yes + persistent: yes + when: ansible_selinux and ansible_selinux.status == "enabled" -- cgit v1.2.3 From 56660d50f1480d6c7ba7b83c4b172084614e6226 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Mon, 26 Oct 2015 22:42:27 -0400 Subject: remove debugging pauses --- roles/openshift_node/tasks/storage_plugins/main.yml | 4 ---- 1 file changed, 4 deletions(-) (limited to 'roles/openshift_node/tasks') diff --git a/roles/openshift_node/tasks/storage_plugins/main.yml b/roles/openshift_node/tasks/storage_plugins/main.yml index 042b38cd3..39c7b9390 100644 --- a/roles/openshift_node/tasks/storage_plugins/main.yml +++ b/roles/openshift_node/tasks/storage_plugins/main.yml @@ -1,6 +1,4 @@ --- -- pause: - # The NFS storage plugin is always enabled since it doesn't require any # additional package dependencies - name: NFS storage plugin configuration @@ -13,5 +11,3 @@ - name: Ceph storage plugin configuration include: ceph.yml when: "'ceph' in openshift.node.storage_plugin_deps" - -- pause: -- cgit v1.2.3