Skip to content

Commit

Permalink
Fix Ansible warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Jan 4, 2019
1 parent 9785a3b commit 9e4b7ca
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
skip_list:
- '204'
- '303'
- '305'
- '405'
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ script:
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml || true; fi
- if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml; fi

notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Set up the latest or a specific version of [Keepalived](http://www.keepalived.or

#### Requirements

* `git-core` (will be installed)
* `git` (will be installed)
* `build-essential` (will be installed)
* `automake` (will be installed)
* `libtool` (will be installed)
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# meta file for keepalived
---
galaxy_info:
role_name: keepalived
author: Mischa ter Smitten
company: Oefenweb.nl B.V.
description: Set up keepalived in Debian-like systems
Expand Down
26 changes: 15 additions & 11 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
value: "{{ keepalived_ip_nonlocal_bind }}"
reload: true
state: present
when: keepalived_ip_nonlocal_bind != false
when: keepalived_ip_nonlocal_bind
tags:
- configuration
- keepalived
- keepalived-ip-nonlocal-bind

- name: install dependencies
apt:
name: "{{ item }}"
name: "{{ keepalived_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
with_items: "{{ keepalived_dependencies }}"
tags:
- configuration
- keepalived
Expand All @@ -27,11 +26,10 @@

- name: install additional
apt:
name: "{{ item }}"
name: "{{ keepalived_install }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
with_items: "{{ keepalived_install }}"
tags:
- configuration
- keepalived
Expand Down Expand Up @@ -65,18 +63,22 @@
- keepalived-checkout-repository

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

- name: build
shell: ./configure {{ keepalived_configure_options | join(' ') }} && make -j{{ ansible_processor_cores + 1 }}
shell: >
./configure {{ keepalived_configure_options | join(' ') }} && make -j{{ ansible_processor_cores + 1 }}
args:
chdir: "{{ keepalived_checkout_path }}"
when: _git_checkout is changed
Expand All @@ -98,7 +100,8 @@
- keepalived-remove-distro

- name: install
shell: make install
shell: >
make install
args:
chdir: "{{ keepalived_checkout_path }}"
when: _git_checkout is changed
Expand All @@ -123,7 +126,8 @@
- keepalived-script-user

- name: cleanup build
shell: git reset --hard && git clean -d -x -f
shell: >
git reset --hard && git clean -d -x -f
args:
chdir: "{{ keepalived_checkout_path }}"
when: _git_checkout is changed
Expand Down Expand Up @@ -153,7 +157,7 @@
group: root
mode: 0755
with_items: "{{ _stat_directories.results }}"
when: item.stat.exists == false
when: not item.stat.exists
tags:
- configuration
- keepalived
Expand Down
3 changes: 2 additions & 1 deletion tasks/service-systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
- keepalived-service-systemd-update

- name: service | systemd | reload
command: systemctl daemon-reload
systemd:
daemon_reload: true
when: _update_systemd_script is changed
tags:
- keepalived-service-systemd-reload
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vars file for keepalived
---
keepalived_dependencies:
- git-core
- git
- build-essential
- automake
- libtool
Expand Down

0 comments on commit 9e4b7ca

Please sign in to comment.