diff --git a/README.md b/README.md index bb131cb..7f45270 100644 --- a/README.md +++ b/README.md @@ -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`) diff --git a/defaults/main.yml b/defaults/main.yml index a390762..3c92629 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 45674c8..9eec701 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 }}" @@ -50,8 +63,19 @@ - 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 @@ -59,6 +83,7 @@ - configuration - keepalived - keepalived-build + - keepalived-build-configure-make - name: remove (distro version) apt: diff --git a/tests/vagrant.yml b/tests/vagrant.yml index 28f2fac..7f49b73 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -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: diff --git a/vars/main.yml b/vars/main.yml index 8246ff2..ebfb911 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -3,6 +3,8 @@ keepalived_dependencies: - git-core - build-essential + - automake + - pkg-config - libssl-dev keepalived_checkout_path: /var/lib/ansible/keepalived/checkouts/keepalived