Created
December 20, 2017 21:01
-
-
Save alexcheng1982/9e2c4672e41d870df9988c83560f3034 to your computer and use it in GitHub Desktop.
Ansible task to setup Nginx on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: install nginx | |
win_chocolatey: | |
name: nginx | |
state: present | |
- name: install nssm | |
win_chocolatey: | |
name: nssm | |
state: present | |
- name: copy nginx conf file | |
win_template: | |
src: nginx.conf.j2 | |
dest: C:\ProgramData\chocolatey\lib\nginx\tools\nginx-1.12.1\conf\nginx.conf | |
- name: install nginx as service | |
win_nssm: | |
name: nginx | |
application: C:\ProgramData\chocolatey\lib\nginx\tools\nginx-1.12.1\nginx.exe | |
app_parameters_free_form: -c C:\ProgramData\chocolatey\lib\nginx\tools\nginx-1.12.1\conf\nginx.conf -p C:\ProgramData\chocolatey\lib\nginx\tools\nginx-1.12.1 | |
stdout_file: C:\nginx_out.txt | |
stderr_file: C:\nginx_error.txt | |
start_mode: auto | |
state: started | |
notify: | |
- start nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment