#!/bin/bash
dir=$(dirname $0)

echo -e "\033[32m>>>>部署ansible\033[0m"
${dir}/shell/install-ansible.sh

\cp ${dir}/config ${dir}/ansible/hosts/hosts

ansible-playbook -i ${dir}/ansible/hosts/hosts ${dir}/ansible/00* --become  --become-method=sudo --become-user=root
ansible-playbook -i ${dir}/ansible/hosts/hosts ${dir}/ansible/10* 
ansible-playbook -i ${dir}/ansible/hosts/hosts ${dir}/ansible/09* --become  --become-method=sudo --become-user=root
ansible-playbook -i ${dir}/ansible/hosts/hosts ${dir}/ansible/01* --become  --become-method=sudo --become-user=root
ansible-playbook -i ${dir}/ansible/hosts/hosts ${dir}/ansible/02* --become  --become-method=sudo --become-user=root
echo -e "\033[32m>>>>更新内核完毕，正在自动重启系统，完成之后(约2-3分钟)~,执行"install.sh"\033[0m"
