Skip to content

Commit

Permalink
Merge pull request #6 from Oefenweb/added-rhel-7-support
Browse files Browse the repository at this point in the history
Added RHEL 7 support
  • Loading branch information
tersmitten committed Sep 14, 2015
2 parents 5537544 + 92fd9ab commit 7bf31dd
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 22 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ python: "2.7"

env:
- ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=1.9.3
- ANSIBLE_VERSION=1.9.2
- ANSIBLE_VERSION=1.9.1
- ANSIBLE_VERSION=1.9.0.1
- ANSIBLE_VERSION=1.8.4
Expand Down Expand Up @@ -57,9 +59,6 @@ install:
# Install Ansible.
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi

# Add ansible.cfg to pick up roles path.
- printf "[defaults]\nroles_path = ../" > ansible.cfg

script:
# Check the role/playbook's syntax.
- ansible-playbook -i tests/inventory tests/test.yml --syntax-check
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ None
---
- hosts: all
roles:
- keepalived
- keepalived
```

##### HAProxy
Expand Down
2 changes: 0 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

role = File.basename(File.expand_path(File.dirname(__FILE__)))

File.open(File.dirname(__FILE__) + '/ansible.cfg', 'w') { |f| f.write("[defaults]\nroles_path = ../") }

boxes = [
{
:name => "ubuntu-1004",
Expand Down
19 changes: 11 additions & 8 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ galaxy_info:
license: MIT
min_ansible_version: 1.4
platforms:
- name: Ubuntu
versions:
- lucid
- precise
- trusty
- name: Ubuntu
versions:
- lucid
- precise
- trusty
- name: EL
versions:
- 7
categories:
- system
- networking
- clustering
- system
- networking
- clustering
dependencies: []
40 changes: 34 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# tasks file for keepalived
---
- name: install package
- name: install dependencies
yum:
name: "{{ item }}"
state: present
update_cache: true
with_items: keepalived_dependencies
when: ansible_os_family == 'RedHat'
tags:
- configuration
- keepalived
- keepalived-install
- keepalived-install-redhat

- name: install dependencies
apt:
name: keepalived
name: "{{ item }}"
state: latest
update_cache: true
cache_valid_time: 3600
tags: [configuration, keepalived, keepalived-install]
with_items: keepalived_dependencies
when: ansible_os_family == 'Debian'
tags:
- configuration
- keepalived
- keepalived-install
- keepalived-install-debian

- name: update configuration file
template:
Expand All @@ -16,7 +35,10 @@
group: root
mode: 0640
notify: restart keepalived
tags: [configuration, keepalived, keepalived-configuration]
tags:
- configuration
- keepalived
- keepalived-configuration

- name: allow binding non-local IP
sysctl:
Expand All @@ -25,7 +47,10 @@
state: present
notify: reload sysctl
when: keepalived_ip_nonlocal_bind != false
tags: [configuration, keepalived, keepalived-ip-nonlocal-bind]
tags:
- configuration
- keepalived
- keepalived-ip-nonlocal-bind

- name: start and enable service
service:
Expand All @@ -34,4 +59,7 @@
enabled: yes
# Pattern is needed to fix failure in Ubuntu 10.04 and idempotency in 12.04 and 14.04
pattern: /usr/sbin/keepalived
tags: [configuration, keepalived, keepalived-start-enable-service]
tags:
- configuration
- keepalived
- keepalived-start-enable-service
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- hosts: localhost
remote_user: root
roles:
- ansible-keepalived
- ../../
vars:
# Do not try to set net.ipv4.ip_nonlocal_bind, which fails on travis-ci
keepalived_ip_nonlocal_bind: false
2 changes: 1 addition & 1 deletion tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
remote_user: vagrant
sudo: true
roles:
- keepalived
- ../../
vars:
keepalived_vrrp_scripts:
chk_haproxy:
Expand Down
2 changes: 2 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# vars file for keepalived
---
keepalived_dependencies:
- keepalived

0 comments on commit 7bf31dd

Please sign in to comment.