--- # # Autoconfig XML file for email clients # https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration - name: Create directories holding the autoconfig XML file file: state=directory path={{ item }} owner=root group=www-data with_items: - "/var/www/autoconfig" - "/var/www/autoconfig/mail" - "/var/www/well-known/autoconfig" - "/var/www/well-known/autoconfig/mail" - name: Create the autoconfig XML file template: src=var_www_autoconfig_mail_config-v1.1.j2 dest={{ item }} owner=root group=www-data with_items: - "/var/www/autoconfig/mail/config-v1.1.xml" - "/var/www/well-known/autoconfig/mail/config-v1.1.xml" - name: Configure the mail autoconfiguration virtualhost template: src=etc_apache2_sites-available_autoconfig.j2 dest=/etc/apache2/sites-available/autoconfig.conf owner=root group=root notify: restart apache - name: Enable the mail autoconfiguration virtualhost command: a2ensite autoconfig.conf creates=/etc/apache2/sites-enabled/autoconfig.conf notify: restart apache