Skip to content

Commit f289615

Browse files
rufus123456gjmzj
rufus123456
authored andcommitted
添加支持RedHat(only)
1 parent e2fbe85 commit f289615

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

99.clean.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@
179179
tags: rm_ntp
180180
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Debian"
181181

182-
- name: stop and disable chronyd in CentOS
182+
- name: stop and disable chronyd in CentOS/RedHat
183183
service: name=chronyd state=stopped enabled=no
184184
ignore_errors: true
185185
tags: rm_ntp
186-
when: ansible_distribution == "CentOS"
186+
when: ansible_distribution == "CentOS" or ansible_distribution == "RedHat"
187187

188188
- name: clean certs and keys
189189
file: name={{ item }} state=absent

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
|组件|支持|
88
|:-|:-|
9-
|OS|Ubuntu 16.04+, CentOS 7|
9+
|OS|Ubuntu 16.04+, CentOS/RedHat 7|
1010
|k8s|v1.8, v1.9, v1.10, v1.11, v1.12|
1111
|etcd|v3.1, v3.2, v3.3|
1212
|docker|17.03.2-ce, 18.06.1-ce|

roles/chrony/tasks/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
- block:
1212
- name: 配置 chrony server
1313
template: src=server-centos.conf.j2 dest=/etc/chrony.conf
14-
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
14+
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
1515

1616
- name: 配置 chrony server
1717
template: src=server-ubuntu.conf.j2 dest=/etc/chrony/chrony.conf
1818
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16
1919

2020
- name: 启动 chrony server
2121
service: name=chronyd state=restarted enabled=yes
22-
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
22+
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
2323

2424
- name: 启动 chrony server
2525
service: name=chrony state=restarted enabled=yes
@@ -29,15 +29,15 @@
2929
- block:
3030
- name: 配置 chrony client
3131
template: src=client-centos.conf.j2 dest=/etc/chrony.conf
32-
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
32+
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
3333

3434
- name: 配置 chrony client
3535
template: src=client-ubuntu.conf.j2 dest=/etc/chrony/chrony.conf
3636
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16
3737

3838
- name: 启动 chrony client
3939
service: name=chronyd state=restarted enabled=yes
40-
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
40+
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
4141

4242
- name: 启动 chrony client
4343
service: name=chrony state=restarted enabled=yes

roles/lb/tasks/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
- name: yum安装 haproxy
1818
yum: name=haproxy state=latest
19-
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
19+
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
2020

2121
- name: 创建haproxy配置目录
2222
file: name=/etc/haproxy state=directory
2323

2424
- name: 修改centos的haproxy.service
2525
template: src=haproxy.service.j2 dest=/usr/lib/systemd/system/haproxy.service
26-
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
26+
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
2727
tags: restart_lb
2828

2929
- name: 配置 haproxy
@@ -36,7 +36,7 @@
3636

3737
- name: yum安装 keepalived
3838
yum: name=keepalived state=latest
39-
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
39+
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
4040

4141
- name: 创建keepalived配置目录
4242
file: name=/etc/keepalived state=directory

roles/prepare/tasks/centos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- name: 删除centos默认安装
1+
- name: 删除centos/redhat默认安装
22
yum:
33
name:
44
- firewalld

roles/prepare/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Debian"
44

55
- import_tasks: centos.yml
6-
when: ansible_distribution == "CentOS"
6+
when: ansible_distribution == "CentOS" or ansible_distribution == "RedHat"
77

88
- name: prepare some dirs
99
file: name={{ item }} state=directory

0 commit comments

Comments
 (0)