Sin descripción
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.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ---
  2. # Defines tasks applicable across all machines in the infrastructure.
  3. - name: Update apt cache
  4. apt: update_cache=yes
  5. - name: Upgrade all safe packages
  6. apt: upgrade=safe
  7. - name: Install necessities and nice-to-haves
  8. apt: pkg={{ item }} state=installed
  9. with_items:
  10. - apache2
  11. - apt-transport-https
  12. - apticron
  13. - build-essential
  14. - debian-goodies
  15. - git
  16. - htop
  17. - iftop
  18. - iotop
  19. - mosh
  20. - python-software-properties
  21. - ruby1.9.3
  22. - screen
  23. - sudo
  24. - update-notifier-common
  25. - vim
  26. - zsh
  27. - name: Set timezone to UTC
  28. action: shell echo Etc/UTC > /etc/timezone
  29. - name: Set localtime to UTC
  30. file: src=/usr/share/zoneinfo/Etc/UTC dest=/etc/localtime
  31. - name: Reconfigure tzdata
  32. action: command dpkg-reconfigure -f noninteractive tzdata
  33. when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
  34. - name: Install unattended upgrades (Debian/Ubuntu only)
  35. apt: pkg=unattended-upgrades state=installed
  36. when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
  37. - name: Apticron email configuration
  38. template: src=apticron.conf.j2 dest=/etc/apticron/apticron.conf
  39. - name: Disable default Apache site
  40. command: a2dissite 000-default removes=/etc/apache2/sites-enabled/000-default
  41. notify: restart apache
  42. - name: Enable Apache headers module
  43. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  44. notify: restart apache
  45. - name: Set ServerName for Apache
  46. template: src=fqdn.j2 dest=/etc/apache2/conf.d/fqdn
  47. notify: restart apache
  48. when: ansible_distribution_release != 'trusty'
  49. - name: Create ServerName configuration file for Apache for Ubuntu Trusty
  50. template: src=fqdn.j2 dest=/etc/apache2/conf-available/fqdn.conf
  51. when: ansible_distribution_release == 'trusty'
  52. - name: Set ServerName for Apache for Ubuntu Trusty
  53. command: a2enconf fqdn creates=/etc/apache2/conf-enabled/fqdn.conf
  54. notify: restart apache
  55. when: ansible_distribution_release == 'trusty'
  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'