4:ae976b742c85
Anton Shestakov <av6@dwimlabs.net>, Sat, 20 Feb 2016 17:26:46 +0800
add an example playbook

next change 17:5a3522b5fd5c
previous change 2:88933f6c62bd

roles/hgweb/tasks/main.yml

Permissions: -rw-r--r--

Other formats: Feeds:
---
- name: Create user
user: name={{ user }}
- name: Install packages
apt: pkg={{ item }} state=present
with_items:
- build-essential
- mercurial
- python-dev
- python-virtualenv
tags: [packages, inert]
- name: Install virtualenv
apt: pkg=virtualenv state=present
when: ansible_distribution_release == 'jessie'
tags: [packages, inert]
- include: appinstall.yml
become: yes
become_user: '{{ user }}'
- name: Add supervisor app
template: src=etc/supervisor/conf.d/hgweb.conf dest=/etc/supervisor/conf.d/hgweb.conf
notify:
- reload supervisor
- name: Add {{ subdomain }}.{{ hostname }} Nginx site
template: src=etc/nginx/sites-available/hgweb dest=/etc/nginx/sites-available/{{ subdomain }}.{{ hostname }}
notify:
- restart nginx
- name: Enable {{ subdomain }}.{{ hostname }} Nginx site
file: src=/etc/nginx/sites-available/{{ subdomain }}.{{ hostname }} dest=/etc/nginx/sites-enabled/50{{ subdomain }}.{{ hostname }} state=link
notify:
- restart nginx
...