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

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