Skip to content

Instantly share code, notes, and snippets.

@april
Last active October 12, 2016 22:10
Show Gist options
  • Save april/e129c297e345bc73ed5ffc1cced45052 to your computer and use it in GitHub Desktop.
Save april/e129c297e345bc73ed5ffc1cced45052 to your computer and use it in GitHub Desktop.
---
- hosts: web
become: true
become_user: root
tasks:
- name: Install nginx signing key
apt_key: url=https://nginx.org/keys/nginx_signing.key state=present
- name: Add nginx binary repository
apt_repository: repo='deb https://nginx.org/packages/mainline/ubuntu {{ ansible_distribution_release }} nginx' state=present
- name: Add nginx source repository
apt_repository: repo='deb-src https://nginx.org/packages/mainline/ubuntu {{ ansible_distribution_release }} nginx' state=present
- name: Install nginx
apt: pkg=nginx state=installed update_cache=true
notify:
- Restart nginx
- name: Install pokeinthe.io nginx configuration
copy: src=../files/nginx-pokeinthe.io.conf dest=/etc/nginx/sites-available/pokeinthe.io.conf mode=0644 owner=root group=root
notify:
- Reload nginx
handlers:
- name: Restart nginx
service: name=nginx state=restarted
- name: Reload nginx
service: name=nginx state=reloaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment