diff --git a/99.clean.yml b/99.clean.yml index 7353c51..ebd7d22 100644 --- a/99.clean.yml +++ b/99.clean.yml @@ -72,7 +72,7 @@ && iptables -F -t mangle && iptables -X -t mangle" - name: 清理网络 - shell: "ip link del docker0; ip link del tunl0; systemctl restart networking" + shell: "ip link del docker0; ip link del tunl0; systemctl restart networking; systemctl restart network" ignore_errors: true - hosts: etcd diff --git a/roles/deploy/templates/kubedns.yaml.j2 b/roles/deploy/templates/kubedns.yaml.j2 index 6a6a967..f8f2b72 100644 --- a/roles/deploy/templates/kubedns.yaml.j2 +++ b/roles/deploy/templates/kubedns.yaml.j2 @@ -14,7 +14,7 @@ metadata: name: kube-dns namespace: kube-system labels: - kubernetes.io/cluster-service: "true" + #kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile --- @@ -25,7 +25,7 @@ metadata: namespace: kube-system labels: k8s-app: kube-dns - kubernetes.io/cluster-service: "true" + #kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile kubernetes.io/name: "KubeDNS" spec: @@ -48,7 +48,7 @@ metadata: namespace: kube-system labels: k8s-app: kube-dns - kubernetes.io/cluster-service: "true" + #kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile spec: # replicas: not specified here: diff --git a/roles/prepare/tasks/main.yml b/roles/prepare/tasks/main.yml index 9b4726c..54c6b1a 100644 --- a/roles/prepare/tasks/main.yml +++ b/roles/prepare/tasks/main.yml @@ -32,6 +32,26 @@ - name: 缓存ansilbe setup信息 setup: gather_subset=min +# 删除默认安装 +- name: 删除ubuntu默认安装 + when: ansible_distribution == "Ubuntu" + apt: name={{ item }} state=absent + with_items: + - ufw + - lxd + - lxd-client + - lxcfs + - lxc-common + +# 删除默认安装 +- name: 删除centos默认安装 + when: ansible_distribution == "CentOS" + yum: name={{ item }} state=absent + with_items: + - firewalld + - firewalld-filesystem + - python-firewall + - name: 关闭 selinux shell: "setenforce 0 && echo SELINUX=disabled > /etc/selinux/config" when: ansible_distribution == "CentOS"