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.8KB

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