Skip to content

Commit

Permalink
修改ansible配置默认不进行gather_facts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgao1983 committed Nov 12, 2017
1 parent d68e1f2 commit 18a3ad4
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 22 deletions.
3 changes: 0 additions & 3 deletions 01.prepare.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# 在deploy节点生成CA相关证书,以供整个集群使用
- hosts: deploy
gather_facts: False
roles:
- ca

# 集群节点的公共配置任务
- hosts: kube-cluster
gather_facts: False
roles:
- prepare

# 可选,多master部署时的负载均衡配置
- hosts: lb
gather_facts: False
roles:
- lb
1 change: 0 additions & 1 deletion 02.etcd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- hosts: etcd
gather_facts: False
roles:
- etcd
1 change: 0 additions & 1 deletion 03.kubectl.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- hosts: kube-cluster
gather_facts: False
roles:
- kubectl
1 change: 0 additions & 1 deletion 04.docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- hosts: kube-cluster
gather_facts: False
roles:
- docker
1 change: 0 additions & 1 deletion 05.calico.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- hosts: kube-cluster
gather_facts: False
roles:
- calico
1 change: 0 additions & 1 deletion 06.kube-master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- hosts: kube-master
gather_facts: False
roles:
- kube-master
1 change: 0 additions & 1 deletion 07.kube-node.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- hosts: kube-node
gather_facts: False
roles:
- kube-node
7 changes: 0 additions & 7 deletions 90.setup.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
# 在deploy节点生成CA相关证书,以供整个集群使用
- hosts: deploy
gather_facts: False
roles:
- ca

# 集群节点的公共配置任务
- hosts: kube-cluster
gather_facts: False
roles:
- prepare

# 可选,多master部署时的负载均衡配置
- hosts: lb
gather_facts: False
roles:
- lb

- hosts: etcd
gather_facts: False
roles:
- etcd

- hosts: kube-cluster
gather_facts: False
roles:
- kubectl
- docker
- calico

- hosts: kube-master
gather_facts: False
roles:
- kube-master

- hosts: kube-node
gather_facts: False
roles:
- kube-node
5 changes: 0 additions & 5 deletions 95.clean.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- hosts: kube-cluster
gather_facts: False
tasks:
- name: stop calico-node service
shell: "systemctl stop calico-node docker"
Expand Down Expand Up @@ -33,7 +32,6 @@
ignore_errors: true

- hosts: kube-node
gather_facts: False
tasks:
- name: stop kube-node service
shell: "systemctl stop kubelet kube-proxy"
Expand All @@ -53,7 +51,6 @@
# - "/root/local/bin/"

- hosts: kube-master
gather_facts: False
tasks:
- name: stop kube-master service
shell: "systemctl stop kube-apiserver kube-controller-manager kube-scheduler"
Expand All @@ -69,7 +66,6 @@
- "/etc/kubernetes/"

- hosts: etcd
gather_facts: False
tasks:
- name: stop etcd service
shell: systemctl stop etcd
Expand All @@ -83,7 +79,6 @@
- "/etc/systemd/system/etcd.service"

- hosts: lb
gather_facts: False
tasks:
- name: stop keepalived service
shell: systemctl disable keepalived && systemctl stop keepalived
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# smart - gather by default, but don't regather if already gathered
# implicit - gather by default, turn off with gather_facts: False
# explicit - do not gather by default, must say gather_facts: True
#gathering = implicit
gathering = explicit

# additional paths to search for roles in, colon separated
roles_path = /etc/ansible/roles
Expand Down

0 comments on commit 18a3ad4

Please sign in to comment.