Skip to content

Commit

Permalink
Make 1.2.24 the default version (#17)
Browse files Browse the repository at this point in the history
* Make 1.2.24 the default version
* Add support for ./configure options
  • Loading branch information
tersmitten authored Sep 15, 2016
1 parent 85555d6 commit 43076e9
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ Set up the latest or a specific version of [Keepalived](http://www.keepalived.or

#### Requirements

None
- `git-core` (will be installed)
- `build-essential` (will be installed)
- `automake` (will be installed)
- `pkg-config` (will be installed)
- `libssl-dev` (will be installed)

#### Variables

* `keepalived_version` [default: `v1.2.20`]: Keepalived version to install (e.g. `v1.2.20`)
* `keepalived_version` [default: `v1.2.24`]: Keepalived version to install

* `keepalived_install`: [default: `[]`]: Additional packages to install (e.g. `['libnl-3-dev', 'libnl-genl-3-dev', 'libnl-route-3-dev', 'libnfnetlink-dev']`)
* `keepalived_configure_options`: [default: `[]`]: Options to pass to `./configure`

* `keepalived_options`: [default: `[]`]: Options to pass to the `keepalived`
* `keepalived_options.{n}.name`: [required]: Option name (e.g. `log-facility`)
Expand Down
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# defaults file for keepalived
---
keepalived_version: v1.2.20
keepalived_version: v1.2.24
keepalived_install: []
keepalived_configure_options: []
keepalived_options: []

keepalived_ip_nonlocal_bind: 1
Expand Down
27 changes: 26 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@
- keepalived-install
- keepalived-install-dependencies

- name: install additional
apt:
name: "{{ item }}"
state: latest
update_cache: true
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
with_items: "{{ keepalived_install }}"
tags:
- configuration
- keepalived
- keepalived-install
- keepalived-install-additional

- name: create (checkout) directory
file:
path: "{{ keepalived_checkout_path }}"
Expand All @@ -50,15 +63,27 @@
- keepalived-checkout
- keepalived-checkout-repository

- name: regenerate the build files
shell: aclocal && autoheader && automake --add-missing && autoreconf
args:
chdir: "{{ keepalived_checkout_path }}"
when: git_checkout | changed and keepalived_version | version_compare('v1.2.24', '>=')
tags:
- configuration
- keepalived
- keepalived-build
- keepalived-build-regenerate-build-files

- name: build
shell: ./configure && make
shell: ./configure {{ keepalived_configure_options | join(' ') }} && make
args:
chdir: "{{ keepalived_checkout_path }}"
when: git_checkout | changed
tags:
- configuration
- keepalived
- keepalived-build
- keepalived-build-configure-make

- name: remove (distro version)
apt:
Expand Down
12 changes: 12 additions & 0 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
roles:
- ../../
vars:
# keepalived_install:
# - libnl-3-dev
# - libnl-genl-3-dev
# - libnl-route-3-dev
# - libnfnetlink-dev
# - libipset-dev
# - libiptcdata0-dev
# - iptables-dev
#
# keepalived_configure_options:
# - '--enable-sha1'

keepalived_options:
- name: log-detail
# keepalived_vrrp_script_map:
Expand Down
2 changes: 2 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
keepalived_dependencies:
- git-core
- build-essential
- automake
- pkg-config
- libssl-dev

keepalived_checkout_path: /var/lib/ansible/keepalived/checkouts/keepalived
Expand Down

0 comments on commit 43076e9

Please sign in to comment.