From 59d8ac53795d1a444d3a73c6674e82c92db02f6e Mon Sep 17 00:00:00 2001 From: jmgao Date: Fri, 15 Dec 2017 19:14:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=20centos=E5=AE=89=E8=A3=85keepalived?= =?UTF-8?q?=E5=92=8Chaproxy=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/lb/tasks/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/lb/tasks/main.yml b/roles/lb/tasks/main.yml index 8d28740..2dcb1f8 100644 --- a/roles/lb/tasks/main.yml +++ b/roles/lb/tasks/main.yml @@ -18,7 +18,7 @@ file: name=/etc/haproxy state=directory - name: 创建haproxy工作目录 - file: name=/run/haproxy state=directory + file: name=/run/haproxy state=directory owner=haproxy group=haproxy - name: 配置 haproxy template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg @@ -31,6 +31,11 @@ yum: name=keepalived state=latest when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" +# CentOS 需要安装psmisc 才能使用命令killall,它在keepalive的监测脚本中使用到 +- name: yum安装 psmisc + yum: name=psmisc state=latest + when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" + - name: 创建keepalived配置目录 file: name=/etc/keepalived state=directory