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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. tags:
  7. - deps
  8. - name: Update apt cache
  9. apt: update_cache=yes
  10. tags:
  11. - deps
  12. - name: Upgrade all safe packages
  13. apt: upgrade=safe
  14. tags:
  15. - deps
  16. - name: Install necessities and nice-to-haves
  17. apt: pkg={{ item }} state=installed
  18. with_items:
  19. - apache2
  20. - apt-transport-https
  21. - apticron
  22. - build-essential
  23. - debian-goodies
  24. - git
  25. - htop
  26. - iftop
  27. - iotop
  28. - mosh
  29. - python-software-properties
  30. - ruby1.9.3
  31. - screen
  32. - sudo
  33. - update-notifier-common
  34. - unattended-upgrades
  35. - molly-guard
  36. - vim
  37. - zsh
  38. tags:
  39. - deps
  40. - name: Set timezone to UTC
  41. action: shell echo Etc/UTC > /etc/timezone
  42. - name: Set localtime to UTC
  43. file: src=/usr/share/zoneinfo/Etc/UTC dest=/etc/localtime
  44. - name: Reconfigure tzdata
  45. action: command dpkg-reconfigure -f noninteractive tzdata
  46. when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
  47. - name: Apticron email configuration
  48. template: src=apticron.conf.j2 dest=/etc/apticron/apticron.conf
  49. - name: Disable default Apache site
  50. command: a2dissite 000-default removes=/etc/apache2/sites-enabled/000-default
  51. notify: restart apache
  52. - name: Enable Apache headers module
  53. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  54. notify: restart apache
  55. - name: Set ServerName for Apache
  56. template: src=fqdn.j2 dest=/etc/apache2/conf.d/fqdn
  57. notify: restart apache
  58. when: ansible_distribution_release != 'trusty'
  59. - name: Create ServerName configuration file for Apache for Ubuntu Trusty
  60. template: src=fqdn.j2 dest=/etc/apache2/conf-available/fqdn.conf
  61. when: ansible_distribution_release == 'trusty'
  62. - name: Set ServerName for Apache for Ubuntu Trusty
  63. command: a2enconf fqdn creates=/etc/apache2/conf-enabled/fqdn.conf
  64. notify: restart apache
  65. when: ansible_distribution_release == 'trusty'
  66. - name: Create decrypted directory (even if encfs isn't used)
  67. file: state=directory path=/decrypted
  68. - name: Set decrypted directory permissions
  69. file: state=directory path=/decrypted group=mail mode=775
  70. - include: encfs.yml tags=encfs
  71. - include: users.yml tags=users
  72. - include: ssl.yml tags=ssl
  73. - include: ufw.yml tags=ufw
  74. - include: security.yml tags=security
  75. - include: ntp.yml tags=ntp
  76. - include: google_auth.yml tags=google_auth
  77. when: ansible_distribution_release != 'trusty'
  78. - include: google_auth_mod.yml tags=google_auth
  79. when: ansible_distribution_release == 'trusty'