Açıklama Yok
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

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