---
- name: mod_perl Test Application
  hosts: testserver
  tasks:
    - name: Apache and mod_perl
      apt: name=apache2,libapache2-mod-perl2 update_cache=yes
      sudo: True
    - name: Test script
      copy: src=ModPerlTest.pm dest=/usr/lib/perl5/ModPerlTest.pm
      sudo: True
      notify: restart apache
    - name: mod_perl conf
      copy: >
        src=mod-perl-test.conf 
        dest=/etc/apache2/sites-enabled/mod-perl-test.conf
      sudo: True
  handlers:
    - name: restart apache
      command: sudo apachectl restart
