ansible: fix install tasks for Debian/Ubuntu

pull/182/head
Laurent Grawet 2019-11-27 17:04:15 +01:00
parent d9870d15a0
commit 9896a5ee62
2 changed files with 7 additions and 5 deletions

View File

@ -3,15 +3,16 @@
yum:
list=haproxy
register: is_installed
when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS')
- name: HAProxy has already installed
debug:
msg: "HAProxy has already installed"
when: is_installed.results|selectattr("yumstate", "match", "installed")|list|length != 0
when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS') and is_installed.results|selectattr("yumstate", "match", "installed")|list|length != 0
- name: Exiting
meta: end_play
when: is_installed.results|selectattr("yumstate", "match", "installed")|list|length != 0
when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS') and is_installed.results|selectattr("yumstate", "match", "installed")|list|length != 0
- name: install HAProxy {{HAPVER}}
yum:

View File

@ -3,6 +3,7 @@
yum:
list=keepalived
register: is_installed
when: (ansible_facts['os_family'] == "RedHat") or (ansible_facts['os_family'] == 'CentOS')
- name: Keepalived has already installed
debug:
@ -11,7 +12,7 @@
- name: Exiting
meta: end_play
when: is_installed.results|selectattr("yumstate", "match", "installed")|list|length != 0
when: (ansible_facts['os_family'] == "RedHat") or (ansible_facts['os_family'] == 'CentOS') and is_installed.results|selectattr("yumstate", "match", "installed")|list|length != 0
- name: install the latest version of Keepalived