No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

z-push.yml 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ---
  2. # Installs and configures the Z-Push "ActiveSync" push notifications.
  3. - name: Ensure repository key for Z-Push is in place
  4. apt_key:
  5. url=http://repo.z-hub.io/z-push:/final/Debian_9.0/Release.key
  6. state=present
  7. tags:
  8. - dependencies
  9. when: ansible_distribution_version == '9'
  10. - name: Add Z-Push repository
  11. apt_repository:
  12. repo="deb http://repo.z-hub.io/z-push:/final/Debian_9.0/ /"
  13. tags:
  14. - dependencies
  15. when: ansible_distribution_version == '9'
  16. - name: Install Z-Push
  17. apt:
  18. name: "{{ packages }}"
  19. state: present
  20. vars:
  21. packages:
  22. - z-push-common
  23. - z-push-backend-combined
  24. - z-push-backend-imap
  25. - z-push-backend-carddav
  26. - z-push-backend-caldav
  27. - z-push-ipc-sharedmemory
  28. - z-push-config-apache
  29. - z-push-autodiscover
  30. tags:
  31. - dependencies
  32. when: ansible_distribution_version == '9'
  33. - name: Install Z-Push
  34. apt:
  35. name: "{{ packages }}"
  36. state: present
  37. vars:
  38. packages:
  39. - z-push
  40. - z-push-common
  41. - z-push-backend-combined
  42. - z-push-backend-imap
  43. - z-push-backend-carddav
  44. - z-push-backend-caldav
  45. tags:
  46. - dependencies
  47. when: ansible_distribution_version == '10'
  48. - name: Ensure Z-Push state and log directories are in place
  49. file:
  50. state=directory
  51. path={{ item }}
  52. owner=www-data
  53. group=www-data
  54. mode=0755
  55. with_items:
  56. - /data/zpush-state
  57. - /var/log/z-push
  58. notify: restart apache
  59. when: ansible_distribution_version != '11'
  60. - name: Copy Z-Push common config.php into place
  61. template:
  62. src=usr_share_z-push_config.php.j2
  63. dest=/usr/share/z-push/config.php
  64. when: ansible_distribution_version != '11'
  65. - name: Copy Z-Push combined backend config.php into place
  66. template:
  67. src=usr_share_z-push_backend_combined_config.php.j2
  68. dest=/usr/share/z-push/backend/combined/config.php
  69. when: ansible_distribution_version != '11'
  70. - name: Copy Z-Push IMAP backend config.php into place
  71. template:
  72. src=usr_share_z-push_backend_imap_config.php.j2
  73. dest=/usr/share/z-push/backend/imap/config.php
  74. when: ansible_distribution_version != '11'
  75. - name: Copy Z-Push CardDAV backend config.php into place
  76. template:
  77. src=usr_share_z-push_backend_carddav_config.php.j2
  78. dest=/usr/share/z-push/backend/carddav/config.php
  79. when: ansible_distribution_version != '11'
  80. - name: Copy Z-Push CalDAV backend config.php into place
  81. template:
  82. src=usr_share_z-push_backend_caldav_config.php.j2
  83. dest=/usr/share/z-push/backend/caldav/config.php
  84. when: ansible_distribution_version != '11'
  85. - name: Copy Z-Push autodiscover config.php into place
  86. template:
  87. src=usr_share_z-push_autodiscover_config.php.j2
  88. dest=/usr/share/z-push/autodiscover/config.php
  89. when: ansible_distribution_version != '11'
  90. - name: Add Z-Push autodiscover to Apache config
  91. lineinfile:
  92. path: /etc/apache2/conf-available/z-push.conf
  93. line: ' AliasMatch (?i)/Autodiscover/Autodiscover.xml$ "/usr/share/z-push/autodiscover/autodiscover.php"'
  94. insertafter: 'Microsoft-Server-ActiveSync'
  95. notify: restart apache
  96. when: ansible_distribution_version != '11'
  97. - name: Enable z-push Apache alias and PHP configuration file
  98. command: a2enconf z-push creates=/etc/apache2/conf-enabled/z-push.conf
  99. notify: restart apache
  100. when: ansible_distribution_version != '11'
  101. - name: Configure z-push logrotate
  102. copy:
  103. src=etc_logrotate_z-push
  104. dest=/etc/logrotate.d/z-push.lr
  105. owner=root
  106. group=root
  107. mode=0644
  108. when: ansible_distribution_version != '11'