From 7e7896ed98a7e6c39084c87367943d17ec5eeddd Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 24 Nov 2016 12:54:34 -0500 Subject: [PATCH] Rework include OS-specific variables logic Because ubuntu-xenial is using systemd, and trusty is not, we now have the need to do specific things on each version of ubuntu. As a result, we now have 3 vars files to include. Change-Id: I728ddd3e464a63398e16480407e0f1482bf4e106 Signed-off-by: Paul Belanger --- tasks/main.yaml | 7 ++- vars/{RedHat.yaml => centos-7.yaml} | 0 vars/{Debian.yaml => ubuntu-trusty.yaml} | 0 vars/ubuntu-xenial.yaml | 67 ++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) rename vars/{RedHat.yaml => centos-7.yaml} (100%) rename vars/{Debian.yaml => ubuntu-trusty.yaml} (100%) create mode 100644 vars/ubuntu-xenial.yaml diff --git a/tasks/main.yaml b/tasks/main.yaml index 107d261..d0db74f 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -13,7 +13,12 @@ # under the License. --- - name: Include OS-specific variables. - include_vars: "{{ ansible_os_family }}.yaml" + include_vars: "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yaml" + when: ansible_os_family == 'Debian' + +- name: Include OS-specific variables. + include_vars: "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version }}.yaml" + when: ansible_os_family == 'RedHat' - include: "{{ nodepool_task }}.yaml" with_items: "{{ nodepool_task_manager }}" diff --git a/vars/RedHat.yaml b/vars/centos-7.yaml similarity index 100% rename from vars/RedHat.yaml rename to vars/centos-7.yaml diff --git a/vars/Debian.yaml b/vars/ubuntu-trusty.yaml similarity index 100% rename from vars/Debian.yaml rename to vars/ubuntu-trusty.yaml diff --git a/vars/ubuntu-xenial.yaml b/vars/ubuntu-xenial.yaml new file mode 100644 index 0000000..77cc073 --- /dev/null +++ b/vars/ubuntu-xenial.yaml @@ -0,0 +1,67 @@ +# Copyright 2015 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# Copyright 2015 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +--- +__nodepool_build_depends: + - git + - libffi-dev + - libssl-dev + - libxml2-dev + - libxslt1-dev + - python-dev + - zlib1g-dev + +__nodepool_file_nodepool_service_dest: /etc/init.d/nodepool +__nodepool_file_nodepool_service_mode: 0755 +__nodepool_file_nodepool_service_src: etc/init.d/nodepool + +__nodepool_file_nodepool_service_config_dest: /etc/default/nodepool +__nodepool_file_nodepool_service_config_mode: 0644 +__nodepool_file_nodepool_service_config_src: etc/default/nodepool + +__nodepool_file_nodepool_builder_service_dest: /etc/init.d/nodepool-builder +__nodepool_file_nodepool_builder_service_mode: 0755 +__nodepool_file_nodepool_builder_service_src: etc/init.d/nodepool-builder + +__nodepool_file_nodepool_builder_service_config_dest: /etc/default/nodepool-builder +__nodepool_file_nodepool_builder_service_config_mode: 0644 +__nodepool_file_nodepool_builder_service_config_src: etc/default/nodepool-builder + +__nodepool_file_nodepool_deleter_service_dest: /etc/init.d/nodepool-deleter +__nodepool_file_nodepool_deleter_service_mode: 0755 +__nodepool_file_nodepool_deleter_service_src: etc/init.d/nodepool-deleter + +__nodepool_file_nodepool_deleter_service_config_dest: /etc/default/nodepool-deleter +__nodepool_file_nodepool_deleter_service_config_mode: 0644 +__nodepool_file_nodepool_deleter_service_config_src: etc/default/nodepool-deleter + +__nodepool_file_nodepool_launcher_service_dest: /etc/init.d/nodepool-launcher +__nodepool_file_nodepool_launcher_service_mode: 0755 +__nodepool_file_nodepool_launcher_service_src: etc/init.d/nodepool-launcher + +__nodepool_file_nodepool_launcher_service_config_dest: /etc/default/nodepool-launcher +__nodepool_file_nodepool_launcher_service_config_mode: 0644 +__nodepool_file_nodepool_launcher_service_config_src: etc/default/nodepool-launcher