123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- ---
- # Installs and configures the Z-Push "ActiveSync" push notifications.
-
- - name: Ensure repository key for Z-Push is in place
- apt_key:
- url=http://repo.z-hub.io/z-push:/final/Debian_9.0/Release.key
- state=present
- tags:
- - dependencies
- when: ansible_distribution_version == '9'
-
- - name: Add Z-Push repository
- apt_repository:
- repo="deb http://repo.z-hub.io/z-push:/final/Debian_9.0/ /"
- tags:
- - dependencies
- when: ansible_distribution_version == '9'
-
- - name: Install Z-Push
- apt:
- name: "{{ packages }}"
- state: present
- vars:
- packages:
- - z-push-common
- - z-push-backend-combined
- - z-push-backend-imap
- - z-push-backend-carddav
- - z-push-backend-caldav
- - z-push-ipc-sharedmemory
- - z-push-config-apache
- - z-push-autodiscover
- tags:
- - dependencies
- when: ansible_distribution_version == '9'
-
- - name: Install Z-Push
- apt:
- name: "{{ packages }}"
- state: present
- vars:
- packages:
- - z-push
- - z-push-common
- - z-push-backend-combined
- - z-push-backend-imap
- - z-push-backend-carddav
- - z-push-backend-caldav
- tags:
- - dependencies
- when: ansible_distribution_version == '10'
-
- - name: Ensure Z-Push state and log directories are in place
- file:
- state=directory
- path={{ item }}
- owner=www-data
- group=www-data
- mode=0755
- with_items:
- - /data/zpush-state
- - /var/log/z-push
- notify: restart apache
- when: ansible_distribution_version != '11'
-
- - name: Copy Z-Push common config.php into place
- template:
- src=usr_share_z-push_config.php.j2
- dest=/usr/share/z-push/config.php
- when: ansible_distribution_version != '11'
-
- - name: Copy Z-Push combined backend config.php into place
- template:
- src=usr_share_z-push_backend_combined_config.php.j2
- dest=/usr/share/z-push/backend/combined/config.php
- when: ansible_distribution_version != '11'
-
- - name: Copy Z-Push IMAP backend config.php into place
- template:
- src=usr_share_z-push_backend_imap_config.php.j2
- dest=/usr/share/z-push/backend/imap/config.php
- when: ansible_distribution_version != '11'
-
- - name: Copy Z-Push CardDAV backend config.php into place
- template:
- src=usr_share_z-push_backend_carddav_config.php.j2
- dest=/usr/share/z-push/backend/carddav/config.php
- when: ansible_distribution_version != '11'
-
- - name: Copy Z-Push CalDAV backend config.php into place
- template:
- src=usr_share_z-push_backend_caldav_config.php.j2
- dest=/usr/share/z-push/backend/caldav/config.php
- when: ansible_distribution_version != '11'
-
- - name: Copy Z-Push autodiscover config.php into place
- template:
- src=usr_share_z-push_autodiscover_config.php.j2
- dest=/usr/share/z-push/autodiscover/config.php
- when: ansible_distribution_version != '11'
-
- - name: Add Z-Push autodiscover to Apache config
- lineinfile:
- path: /etc/apache2/conf-available/z-push.conf
- line: ' AliasMatch (?i)/Autodiscover/Autodiscover.xml$ "/usr/share/z-push/autodiscover/autodiscover.php"'
- insertafter: 'Microsoft-Server-ActiveSync'
- notify: restart apache
- when: ansible_distribution_version != '11'
-
- - name: Enable z-push Apache alias and PHP configuration file
- command: a2enconf z-push creates=/etc/apache2/conf-enabled/z-push.conf
- notify: restart apache
- when: ansible_distribution_version != '11'
-
- - name: Configure z-push logrotate
- copy:
- src=etc_logrotate_z-push
- dest=/etc/logrotate.d/z-push.lr
- owner=root
- group=root
- mode=0644
- when: ansible_distribution_version != '11'
|