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.

main.yml 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. # Defines tasks applicable across all machines in the infrastructure.
  3. - name: Set up closest mirror autoselect (ubuntu-only)
  4. template: src=apt_sources.list.j2 dest=/etc/apt/sources.list
  5. when: ansible_distribution == 'Ubuntu'
  6. - name: Update apt cache
  7. apt: update_cache=yes
  8. - name: Upgrade all safe packages
  9. apt: upgrade=safe
  10. - name: Install necessities and nice-to-haves
  11. apt: pkg={{ item }} state=installed
  12. with_items:
  13. - apache2
  14. - apt-transport-https
  15. - apticron
  16. - build-essential
  17. - debian-goodies
  18. - git
  19. - htop
  20. - iftop
  21. - iotop
  22. - mosh
  23. - python-software-properties
  24. - ruby1.9.3
  25. - screen
  26. - sudo
  27. - update-notifier-common
  28. - vim
  29. - zsh
  30. - name: Install unattended upgrades (Debian/Ubuntu only)
  31. apt: pkg=unattended-upgrades state=installed
  32. when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
  33. - name: Apticron email configuration
  34. template: src=apticron.conf.j2 dest=/etc/apticron/apticron.conf
  35. - name: Disable default Apache site
  36. command: a2dissite 000-default removes=/etc/apache2/sites-enabled/000-default
  37. notify: restart apache
  38. - name: Enable Apache headers module
  39. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  40. notify: restart apache
  41. - name: Set ServerName for Apache
  42. template: src=fqdn.j2 dest=/etc/apache2/conf.d/fqdn
  43. notify: restart apache
  44. when: ansible_distribution_release != 'trusty'
  45. - name: Create ServerName configuration file for Apache for Ubuntu Trusty
  46. template: src=fqdn.j2 dest=/etc/apache2/conf-available/fqdn.conf
  47. when: ansible_distribution_release == 'trusty'
  48. - name: Set ServerName for Apache for Ubuntu Trusty
  49. command: a2enconf fqdn creates=/etc/apache2/conf-enabled/fqdn.conf
  50. notify: restart apache
  51. when: ansible_distribution_release == 'trusty'
  52. - name: Create decrypted directory (even if encfs isn't used)
  53. file: state=directory path=/decrypted
  54. - name: Set decrypted directory permissions
  55. file: state=directory path=/decrypted group=mail mode=775
  56. - include: encfs.yml tags=encfs
  57. - include: users.yml tags=users
  58. - include: ssl.yml tags=ssl
  59. - include: ufw.yml tags=ufw
  60. - include: security.yml tags=security
  61. - include: ntp.yml tags=ntp
  62. - include: google_auth.yml tags=google_auth
  63. when: ansible_distribution_release != 'trusty'
  64. - include: google_auth_mod.yml tags=google_auth
  65. when: ansible_distribution_release == 'trusty'