Browse Source

Merge pull request #182 from lgrawet/ansible_debian

ansible: fix install tasks for Debian/Ubuntu
pull/189/head
Pavel Loginov 5 years ago committed by GitHub
parent
commit
187b6e4e19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      app/scripts/ansible/roles/haproxy/tasks/main.yml
  2. 5
      app/scripts/ansible/roles/keepalived/tasks/install.yml

7
app/scripts/ansible/roles/haproxy/tasks/main.yml

@ -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:
@ -107,4 +108,4 @@
- name: Add syn_flood tasks
include: syn_flood.yml
when: (SYN_FLOOD is defined) and (SYN_FLOOD|length > 0)

5
app/scripts/ansible/roles/keepalived/tasks/install.yml

@ -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
@ -64,4 +65,4 @@
- name: Add syn_flood tasks
include: ../../haproxy/tasks/syn_flood.yml
when: (SYN_FLOOD is defined) and (SYN_FLOOD|length > 0)
when: (SYN_FLOOD is defined) and (SYN_FLOOD|length > 0)

Loading…
Cancel
Save