ansible roles webserver
ansible playbook 原始 wordpress.yml 文件
[root@m01 ~/ansible]#cat wordpress.yml
- hosts: webs
tasks:
- name: Remove Nginx Defualt.conf
file:
path: /etc/nginx/conf.d/default.conf
state: absent
- name: copy wordprees configure to conf.d
copy:
src: a_wordpress.conf
dest: /etc/nginx/conf.d/a_wordpress.conf
- name: copy zh configure to conf.d
copy:
src: zh.conf
dest: /etc/nginx/conf.d/zh.conf
- name: copy phpshe configure to conf.d
copy:
src: phpshe.conf
dest: /etc/nginx/conf.d/phpshe.conf
- name: copy admin configure to conf.d
copy:
src: admin.conf
dest: /etc/nginx/conf.d/admin.conf
- name: mkdir /code
file:
path: /code
state: directory
- name: unarchive wodrepress_code.tar
unarchive:
src: wordpress_1.tar.gz
dest: /code/
creates: /code/wordpress/
- name: unarchive sh_code.tar
unarchive:
src: zh.tar.gz
dest: /code/
creates: /code/zh/
- name: unarchive phpshe.tar
unarchive:
src: phpshe.tar.gz
dest: /code/
creates: /code/phpshe/
- name: unarchive admin.tar
unarchive:
src: admin.tar.gz
dest: /code/
creates: /code/admin/
- name: yum install nfs-utils
yum:
name: nfs-utils
state: present
- name: mount nfs
mount:
src: 172.16.1.31:/code/blog/
path: /code/wordpress/wp-content/uploads/
fstype: nfs
state: mounted
|
欢迎来撩 : 汇总all