标签:task stat alt status mamicode yum service started mic
[root@c7-4-mh02 ansible]# vim mariadb.yaml
--- - hosts: mariadb remote_user: root tasks: - name: install mariadb yum: name=mariadb-server state=present - name: start mariadb service: name=mariadb state=restarted enabled=true
# 检查语法是否正确
ansible-playbook --syntax-check mariadb.yaml
# 执行mariadb.yaml文件,安装并启动mariadb
ansible-playbook mariadb.yaml
# 查看mariadb是否启动
systemctl status mariadb
Ansible-使用playbook自动化部署mariadb
标签:task stat alt status mamicode yum service started mic
原文地址:https://www.cnblogs.com/HsLM/p/12331096.html