2 Star 12 Fork 17

葫芦/ansible-k8s-kubeadm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
remove-k8s.yml 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
葫芦 提交于 2020-07-20 16:18 . auto commit
---
- hosts: k8s
gather_facts: False
tasks:
- name: 移除k8s集群配置
ignore_errors: yes
shell: "kubeadm reset -f"
- name: 卸载相关软件
package:
name:
- kubelet
- kubeadm
- kubectl
- docker-ce
- docker-ce-cli
- containerd.io
- keepalived
state: absent
- name: 开启swap
replace:
path: /etc/fstab
regexp: '^#/(.*) swap (.*)'
replace: '/\1 swap \2'
- hosts: lvs
gather_facts: false
tasks:
- name: 移出lvs软件
package:
name:
- ipvsadm
- keepalived
state: absent
- hosts: master
gather_facts: false
tasks:
- name: 关闭回环地址
ignore_errors: yes
shell: "/bin/bash /usr/local/bin/rsrip.sh stop >/dev/null 2>&1"
- name: 关闭回环地址自启
ignore_errors: yes
lineinfile:
dest: /etc/rc.d/rc.local
regexp: "^/(.*)/rsrip.sh"
state: absent
- name: 去除kubectl补全
ignore_errors: yes
lineinfile:
dest: ~/.bashrc
regexp: "kubectl"
state: absent
- hosts: k8s
gather_facts: false
tasks:
- name: 1分钟后重启k8s服务器
shell: "shutdown -r 1"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/hulu20/ansible-k8s-kubeadm.git
git@gitee.com:hulu20/ansible-k8s-kubeadm.git
hulu20
ansible-k8s-kubeadm
ansible-k8s-kubeadm
master

搜索帮助