main.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. - include_tasks: init.yml
  2. - include_tasks: sshd.yml
  3. - include_tasks: ulimits.yml
  4. - name: Update system
  5. become: true
  6. ansible.builtin.apt:
  7. update_cache: true
  8. cache_valid_time: 3600
  9. when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Kylin'
  10. - name: Update all packages to their latest version
  11. become: true
  12. ansible.builtin.apt:
  13. name: "*"
  14. state: latest
  15. when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Kylin'
  16. - name: Install dependicy packages
  17. become: true
  18. ansible.builtin.apt:
  19. pkg:
  20. - pwgen
  21. - zsh
  22. - git
  23. - tmux
  24. when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Kylin'
  25. - name: Set timezone
  26. become: true
  27. ansible.builtin.shell: timedatectl set-timezone UTC
  28. - name: Setup journald storage
  29. become: true
  30. ansible.builtin.lineinfile:
  31. path: /etc/systemd/journald.conf
  32. regexp: "^#Storage="
  33. line: Storage=persistent
  34. # https://www.linode.com/docs/quick-answers/linux/how-to-use-journalctl/
  35. - name: Setup journald storage keep-free
  36. become: true
  37. ansible.builtin.lineinfile:
  38. path: /etc/systemd/journald.conf
  39. state: present
  40. regexp: "^#SystemKeepFree="
  41. line: SystemKeepFree=6%