Ansible YML语法
---- name: create /srv/nginx directory
file: path=/srv/nginx state=directory mode=0755
- name: sync nginx rpm package
synchronize: src={{ file_path }}/files/rpm/ dest=/srv/nginx/ delete=yes
- name: install nginx
yum: name={{ item }} state=present disable_gpg_check=yes
with_items:
- /srv/nginx/nginx-1.8.1-1.el6.ngx.x86_64.rpm
- name: delete defaults config
file: path=/etc/nginx/conf.d/default.conf state=absent
- name: cp nginx.conf
template: src={{ file_path }}/files/conf/nginx.conf dest=/etc/nginx/nginx.conf
页:
[1]