Created
July 27, 2021 08:49
-
-
Save t0rik/47dd1cffd590a0c75978d602bc27ef14 to your computer and use it in GitHub Desktop.
nginx playbook
This file contains 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
--- | |
- hosts: all | |
tasks: | |
- name: ensure nginx is at the latest version | |
apt: name=nginx state=latest | |
become: yes | |
- name: start nginx | |
service: | |
name: nginx | |
state: started | |
become: yes | |
- name: copy the nginx config file and restart nginx | |
copy: | |
src: /home/foo/static_site.cfg | |
dest: /etc/nginx/sites-available/static_site.cfg | |
become: yes | |
- name: create symlink | |
file: | |
src: /etc/nginx/sites-available/static_site.cfg | |
dest: /etc/nginx/sites-enabled/default | |
state: link | |
become: yes | |
- name: copy the content of the web site | |
copy: | |
src: /home/foo/static-site-src/ | |
dest: /home/foo/static-site | |
- name: restart nginx | |
service: | |
name: nginx | |
state: restarted | |
become: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment