---
- name: Configure monit for status site
  copy: src=monit dest=/etc/monit/web.d/status
  notify:
  - monit
- name: Copy status files
  copy: src=status dest=/var/www/sites/
- name: Make status user
  user: name=status createhome=no shell=/bin/false state=present
# Add authorized_keys
# Change sshd config http://undeadly.org/cgi?action=article&sid=20080220110039
# 
- name: Add status site
  copy: src=status.site dest=/etc/apache2/sites-available/status
  notify:
  - apache2
- name: Enable status site
  file: src=../sites-available/status dest=/etc/apache2/sites-enabled/status state=link
  notify:
  - apache2

---
- name: Configure monit for status site
  copy: src=monit dest=/etc/monit/web.d/status
  notify:
  - monit
- name: Copy status files
  copy: src=status dest=/var/www/sites/
- name: Add status user config in sshd_config
  lineinfile: dest=/etc/ssh/sshd_config state=present line='Match user status'
- name: Make status user sftp only
  lineinfile: dest=/etc/ssh/sshd_config state=present insertafter='Match user status' line='{{ item }}' # ' # Fix hilighting
  with_items:
  - '	ForceCommand internal-sftp'
  - '	ChrootDirectory /var/www/sites/status'
- name: Make status user
  user: name=status createhome=no shell=/bin/false state=present
 - name: Add pubkey for status user
   copy: src=secret/status_id_rsa.pub dest=/home/status/.ssh/authorized_keys
- name: Add status site
  copy: src=status.site dest=/etc/apache2/sites-available/status
  notify:
  - apache2
- name: Enable status site
  file: src=../sites-available/status dest=/etc/apache2/sites-enabled/status state=link
  notify:
  - apache2

Add sftp configuration for status user
Add sftp configuration for status user
