Skip to content

Commit

Permalink
Add CentOS 7 support
Browse files Browse the repository at this point in the history
This patch adds CentOS 7 support for the keepalived role.
  • Loading branch information
major committed Jan 17, 2017
1 parent b3d6b11 commit 8066a05
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
3 changes: 3 additions & 0 deletions meta/main.yml
Expand Up @@ -19,6 +19,9 @@ galaxy_info:
license: Apache
min_ansible_version: 1.9
platforms:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- trusty
Expand Down
28 changes: 28 additions & 0 deletions tasks/keepalived_install_yum.yml
@@ -0,0 +1,28 @@
---
# Copyright 2017, Major Hayden <major@mhtx.net>
#
# 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
8 changes: 7 additions & 1 deletion tasks/main.yml
Expand Up @@ -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
Expand Down Expand Up @@ -150,4 +156,4 @@
- name: Ensuring keepalived is enabled
service:
name: "{{ keepalived_service_name }}"
enabled: "yes"
enabled: "yes"
19 changes: 18 additions & 1 deletion vars/redhat.yml
@@ -1,2 +1,19 @@
---
# add empty file to be able to gather vars
# Copyright 2017, Major Hayden <major@mhtx.net>
#
# 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"

0 comments on commit 8066a05

Please sign in to comment.