暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

main.yml 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. - include: encfs.yml tags=encfs
  53. - include: users.yml tags=users
  54. - include: ssl.yml tags=ssl
  55. - include: ufw.yml tags=ufw
  56. - include: security.yml tags=security
  57. - include: ntp.yml tags=ntp
  58. - include: google_auth.yml tags=google_auth
  59. when: ansible_distribution_release != 'trusty'
  60. - include: google_auth_mod.yml tags=google_auth
  61. when: ansible_distribution_release == 'trusty'