- name: Install postfix 
  apt: 
    pkg:
      - postfix 
      - bsd-mailx 
      - mutt 
      - dovecot-imapd 
      - default-mysql-server 
      - roundcube
    state: present 
    update_cache: true

- name: Modify /etc/dovecot/conf.d/10-master.conf file
  template: src=etc/dovecot/conf.d/10-master.conf.j2 dest=/etc/dovecot/conf.d/10-master.conf

- name: Restart dovecot
  service: name=dovecot state=restarted

- name: Modify /etc/postfix/main.cf file
  template: src=etc/postfix/main.cf.j2 dest=/etc/postfix/main.cf

- name: Restart postfix
  service: name=postfix state=restarted

- name: Modify /var/lib/roundcube/config/config.inc.php file
  template: src=var/lib/roundcube/config/config.inc.php.j2 dest=/var/lib/roundcube/config/config.inc.php

- name: Modify /etc/apache2/conf-enabled/roundcube.conf file
  template: src=etc/apache2/conf-enabled/roundcube.conf.j2 dest=/etc/apache2/conf-enabled/roundcube.conf

- name: Restart apache2
  service: name=apache2 state=restarted
