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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ---
  2. - name: Set hostname
  3. hostname: name="{{ server_hostname }}"
  4. - name: Replace /etc/hosts
  5. template: src=etc_hosts.j2 dest=/etc/hosts
  6. - name: Update apt cache
  7. apt: update_cache=yes
  8. tags:
  9. - dependencies
  10. - name: Upgrade all safe packages
  11. apt: upgrade=safe
  12. tags:
  13. - dependencies
  14. - name: Install necessities and nice-to-haves
  15. apt:
  16. name: "{{ packages }}"
  17. state: present
  18. vars:
  19. packages:
  20. - acl
  21. - apache2
  22. - apt-transport-https
  23. - apticron
  24. - build-essential
  25. - debian-goodies
  26. - git
  27. - htop
  28. - iftop
  29. - iotop
  30. - molly-guard
  31. - mosh
  32. - python3-software-properties
  33. - ruby
  34. - screen
  35. - sudo
  36. - tmux
  37. - unattended-upgrades
  38. - vim
  39. - zsh
  40. tags:
  41. - dependencies
  42. - name: timezone - configure /etc/timezone
  43. copy:
  44. content: "{{ common_timezone | regex_replace('$', '\n') }}"
  45. dest: /etc/timezone
  46. owner: root
  47. group: root
  48. mode: 0644
  49. register: common_timezone_config
  50. - name: timezone - Set localtime to UTC
  51. file: src=/usr/share/zoneinfo/Etc/UTC dest=/etc/localtime
  52. when: common_timezone_config.changed
  53. - name: timezone - reconfigure tzdata
  54. command: dpkg-reconfigure --frontend noninteractive tzdata
  55. when: common_timezone_config.changed
  56. - name: Apticron email configuration
  57. template: src=apticron.conf.j2 dest=/etc/apticron/apticron.conf
  58. - name: Create data directory
  59. file: state=directory path=/data
  60. - name: Set data directory permissions
  61. file: state=directory path=/data group=mail mode=0775
  62. - name: Ensure US English locale exists
  63. locale_gen:
  64. name: en_US.UTF-8
  65. state: present
  66. - name: Ensure German locale exists
  67. locale_gen:
  68. name: de_DE.UTF-8
  69. state: present
  70. - include: users.yml tags=users
  71. - include: apache.yml tags=apache
  72. - include: ufw.yml tags=ufw
  73. - include: security.yml tags=security
  74. - include: ntp.yml tags=ntp
  75. - include: postgres.yml