forked from JasonGiedymin/nginx-init-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-nginx.yml
32 lines (29 loc) · 1 KB
/
deploy-nginx.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
#
# nginx-init-ubuntu install
#
# Warning, do not use this as a production ansible playbook.
# A production one is pending. This is only for testing.
#
- hosts: all
sudo: True
vars:
nginx_version: "1.5.9"
nginx_download_file: "nginx-{{nginx_version}}.tar.gz"
nginx_install_dir: /tmp/nginx-install
handlers:
- name: start nginx
command: service nginx start
tasks:
- file: path={{nginx_install_dir}} state=directory
- apt: pkg={{item}} state=present update_cache=yes
with_items:
- libpcre3-dev
- zlib1g-dev
- get_url: url=http://nginx.org/download/{{nginx_download_file}} dest={{nginx_install_dir}}
- copy: src=./nginx dest=/etc/init.d/nginx force=yes mode=755 owner=root group=root
- command: tar -xvf {{nginx_download_file}} chdir={{nginx_install_dir}}
- name: Compile and install
shell: ./configure && make && make install chdir="{{nginx_install_dir}}/nginx-{{nginx_version}}"
notify: start nginx
- include: integration-tests.yml