本文共 1079 字,大约阅读时间需要 3 分钟。
[root@room8pc16 myansible]# vim lamp.yml---- name: configure dbservers hosts: dbservers tasks: - name: install mariadb yum: name: mariadb-server state: present - name: start mariadb service: name: mariadb state: started enabled: yes- name: configure webservers hosts: webservers tasks: - name: install apache yum: name: [httpd, php, php-mysql] state: latest - name: start httpd service: name: httpd state: started enabled: yes
[ { 'name': 'configure dbservers', 'hosts': 'dbservers', 'tasks': [ { 'name': 'install mariadb', 'yum': { 'name': 'mariadb-server', 'state': 'present' } }, { 'name': 'start mariadb', 'service': { 'name': 'mariadb', 'state': 'started', 'enabled': 'yes' } }, ] }]
转载地址:http://qqnwi.baihongyu.com/