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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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: Set timezone to UTC
  31. action: shell echo Etc/UTC > /etc/timezone
  32. - name: Set localtime to UTC
  33. file: src=/usr/share/zoneinfo/Etc/UTC dest=/etc/localtime
  34. - name: Reconfigure tzdata
  35. action: command dpkg-reconfigure -f noninteractive tzdata
  36. when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
  37. - name: Install unattended upgrades (Debian/Ubuntu only)
  38. apt: pkg=unattended-upgrades state=installed
  39. when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
  40. - name: Apticron email configuration
  41. template: src=apticron.conf.j2 dest=/etc/apticron/apticron.conf
  42. - name: Disable default Apache site
  43. command: a2dissite 000-default removes=/etc/apache2/sites-enabled/000-default
  44. notify: restart apache
  45. - name: Enable Apache headers module
  46. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  47. notify: restart apache
  48. - name: Set ServerName for Apache
  49. template: src=fqdn.j2 dest=/etc/apache2/conf.d/fqdn
  50. notify: restart apache
  51. when: ansible_distribution_release != 'trusty'
  52. - name: Create ServerName configuration file for Apache for Ubuntu Trusty
  53. template: src=fqdn.j2 dest=/etc/apache2/conf-available/fqdn.conf
  54. when: ansible_distribution_release == 'trusty'
  55. - name: Set ServerName for Apache for Ubuntu Trusty
  56. command: a2enconf fqdn creates=/etc/apache2/conf-enabled/fqdn.conf
  57. notify: restart apache
  58. when: ansible_distribution_release == 'trusty'
  59. - name: Create decrypted directory (even if encfs isn't used)
  60. file: state=directory path=/decrypted
  61. - name: Set decrypted directory permissions
  62. file: state=directory path=/decrypted group=mail mode=775
  63. - include: encfs.yml tags=encfs
  64. - include: users.yml tags=users
  65. - include: ssl.yml tags=ssl
  66. - include: ufw.yml tags=ufw
  67. - include: security.yml tags=security
  68. - include: ntp.yml tags=ntp
  69. - include: google_auth.yml tags=google_auth
  70. when: ansible_distribution_release != 'trusty'
  71. - include: google_auth_mod.yml tags=google_auth
  72. when: ansible_distribution_release == 'trusty'