main.yml 779 B

12345678910111213141516171819202122232425262728293031
  1. - import_tasks: sshd.yml
  2. - import_tasks: ulimits.yml
  3. - name: Reset root password
  4. become: true
  5. shell: echo "root:$(pwgen 32 1)" | chpasswd
  6. - name: Reset {{ ansible_user }} password
  7. become: true
  8. shell: echo "{{ ansible_user }}:$(pwgen 32 1)" | chpasswd
  9. when: ansible_user != 'root'
  10. - name: Set timezone
  11. become: true
  12. shell: timedatectl set-timezone UTC
  13. - name: Setup journald storage
  14. become: true
  15. lineinfile:
  16. path: /etc/systemd/journald.conf
  17. regexp: "^#Storage="
  18. line: Storage=persistent
  19. # https://www.linode.com/docs/quick-answers/linux/how-to-use-journalctl/
  20. - name: Setup journald storage keep-free
  21. become: true
  22. lineinfile:
  23. path: /etc/systemd/journald.conf
  24. state: present
  25. regexp: "^#SystemKeepFree="
  26. line: SystemKeepFree=6%