diff --git a/meta/main.yml b/meta/main.yml index b1f7ef5..84c04b1 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -19,6 +19,9 @@ galaxy_info: license: Apache min_ansible_version: 1.9 platforms: + - name: EL + versions: + - 7 - name: Ubuntu versions: - trusty diff --git a/tasks/keepalived_install_yum.yml b/tasks/keepalived_install_yum.yml new file mode 100644 index 0000000..dca4a98 --- /dev/null +++ b/tasks/keepalived_install_yum.yml @@ -0,0 +1,28 @@ +--- +# Copyright 2017, Major Hayden +# +# 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. + +- name: Ensure that the EPEL repository is available + yum: + pkg: epel-release + state: present + tags: + - keepalived-yum-packages + +- name: Install keepalived + yum: + pkg: "{{ keepalived_package_name }}" + state: "{{ keepalived_use_latest_stable | bool | ternary('latest','present') }}" + tags: + - keepalived-yum-packages diff --git a/tasks/main.yml b/tasks/main.yml index 5e546c1..1b3a183 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -30,6 +30,12 @@ tags: - install-apt +- include: keepalived_install_yum.yml + when: + - ansible_pkg_mgr == 'yum' + tags: + - install-yum + - name: Allow consuming apps to bind on non local addresses sysctl: name: net.ipv4.ip_nonlocal_bind @@ -150,4 +156,4 @@ - name: Ensuring keepalived is enabled service: name: "{{ keepalived_service_name }}" - enabled: "yes" \ No newline at end of file + enabled: "yes" diff --git a/vars/redhat.yml b/vars/redhat.yml index 8def633..0379a32 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -1,2 +1,19 @@ --- -# add empty file to be able to gather vars +# Copyright 2017, Major Hayden +# +# 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. + +# Standard names and paths for CentOS 7 +keepalived_package_name: "keepalived" +keepalived_service_name: "keepalived" +keepalived_config_file_path: "/etc/keepalived/keepalived.conf"