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.

roundcube.yml 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. - name: Add backports for Roundcube
  2. lineinfile: dest=/etc/apt/sources.list line="deb http://http.debian.net/debian wheezy-backports main"
  3. - name: Update apt cache for backports
  4. apt: update_cache=yes
  5. - name: Install Roundcube from wheezy-backports
  6. apt: pkg={{ item }} state=latest default_release=wheezy-backports
  7. with_items:
  8. - roundcube
  9. - roundcube-pgsql
  10. - roundcube-plugins
  11. when: ansible_distribution_release == 'wheezy'
  12. - name: Install Roundcube on Ubuntu 14.04 LTS
  13. apt: pkg={{ item }} state=latest
  14. with_items:
  15. - roundcube
  16. - roundcube-pgsql
  17. - roundcube-plugins
  18. when: ansible_distribution_release == 'trusty'
  19. - name: Configure Roundcube database
  20. template: src={{ item.src }} dest={{ item.dest }} group={{ item.group }} mode={{ item.mode }} owner=root force=yes
  21. with_items:
  22. - { src: 'etc_dbconfig-common_roundcube.conf.j2', dest: '/etc/dbconfig-common/roundcube.conf', group: 'root', mode: 600 }
  23. - { src: 'etc_roundcube_debian-db.php.j2', dest: '/etc/roundcube/debian-db.php', group: 'www-data', mode: 640 }
  24. notify: set roundcube password
  25. - name: Download carddav plugin release
  26. get_url:
  27. url=https://github.com/blind-coder/rcmcarddav/archive/carddav_{{ carddav_version }}.tar.gz
  28. dest=/root/carddav_{{ carddav_version }}.tar.gz
  29. - name: Decompress carddav plugin source
  30. command: tar xzf carddav_{{ carddav_version }}.tar.gz chdir=/root creates=/root/rcmcarddav-carddav_{{ carddav_version }}
  31. - name: Move carddav plugin files to /usr/share/roundcube/plugins/carddav
  32. command: mv rcmcarddav-carddav_{{ carddav_version }} /usr/share/roundcube/plugins/carddav chdir=/root creates=/usr/share/roundcube/plugins/carddav
  33. - name: Download Google Authenticator roundcube plugin
  34. git: repo=https://github.com/alexandregz/twofactor_gauthenticator.git
  35. dest=/usr/share/roundcube/plugins/twofactor_gauthenticator
  36. accept_hostkey=yes
  37. - name: Link plugins into /var/lib/roundcube/plugins
  38. file: state=link src=/usr/share/roundcube/plugins/{{ item }} dest=/var/lib/roundcube/plugins/{{ item }} force=yes
  39. with_items:
  40. - carddav
  41. - twofactor_gauthenticator
  42. - name: Rename existing Apache roundcube virtualhost
  43. command: mv /etc/apache2/sites-available/roundcube /etc/apache2/sites-available/roundcube.conf removes=/etc/apache2/sites-available/roundcube
  44. - name: Remove old sites-enabled/roundcube symlink (new one will be created by a2ensite)
  45. command: rm /etc/apache2/sites-enabled/roundcube removes=/etc/apache2/sites-enabled/roundcube
  46. - name: Configure the Apache HTTP server for roundcube
  47. template: src=etc_apache2_sites-available_roundcube.j2 dest=/etc/apache2/sites-available/roundcube.conf group=root owner=root force=yes
  48. - name: Configure roundcube
  49. copy: src={{ item.src }} dest={{ item.dest }} group=www-data owner=root mode=640 force=yes
  50. with_items:
  51. - { src: 'etc_roundcube_global.sieve', dest: '/etc/roundcube/global.sieve' }
  52. - { src: 'etc_roundcube_main.inc.php', dest: '/etc/roundcube/main.inc.php' }
  53. - { src: 'usr_share_roundcube_plugins_carddav_config.inc.php', dest: '/usr/share/roundcube/plugins/carddav/config.inc.php' }
  54. - { src: 'usr_share_roundcube_plugins_managesieve_config.inc.php', dest: '/usr/share/roundcube/plugins/managesieve/config.inc.php' }
  55. - { src: 'usr_share_roundcube_plugins_twofactor_gauthenticator_config.inc.php', dest: '/usr/share/roundcube/plugins/twofactor_gauthenticator/config.inc.php' }
  56. - name: Enable roundcube site
  57. command: a2ensite roundcube.conf creates=/etc/apache2/sites-enabled/roundcube.conf
  58. notify: restart apache