# 重新配置启动 haproxy - hosts: lb tasks: - name: 配置 haproxy template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg - name: 重启haproxy服务 shell: systemctl enable haproxy && systemctl restart haproxy - hosts: kube-master roles: - prepare - kube-master - kube-node