---
- name: dpkg-reconfigure-debconf
  ansible.builtin.command:
    cmd: dpkg-reconfigure --frontend noninteractive debconf

- name: dpkg-reconfigure-locales
  ansible.builtin.command:
    cmd: dpkg-reconfigure --frontend noninteractive locales

- name: dpkg-reconfigure-apt
  ansible.builtin.command:
    cmd: dpkg-reconfigure --frontend noninteractive apt-listchanges

# - name: debconf-set-selections
#   command: debconf-set-selections /root/debconf-preseed

- name: apt update
  ansible.builtin.apt:
    update_cache: yes

- name: restart rsyslog
  ansible.builtin.service:
    name: rsyslog
    state: restarted


- name: remount /home
  ansible.builtin.command:
    cmd: mount -o remount /home

- name: remount /var
  ansible.builtin.command:
    cmd: mount -o remount /var


- name: restart nginx
  ansible.builtin.service:
    name: nginx
    state: restarted

- name: reload nginx
  ansible.builtin.service:
    name: nginx
    state: reloaded

- name: restart apache
  ansible.builtin.service:
    name: apache2
    state: restarted

- name: reload apache
  ansible.builtin.service:
    name: apache2
    state: reloaded

- name: restart cron
  ansible.builtin.service:
    name: cron
    state: restarted

- name: newaliases
  ansible.builtin.command:
    cmd: newaliases
  changed_when: False


- name: reload sshd
  ansible.builtin.service:
    name: ssh
    state: reloaded

- name: reload postfix
  ansible.builtin.service:
    name: postfix
    state: reloaded

- name: restart log2mail
  ansible.builtin.service:
    name: log2mail
    state: restarted

- name: restart systemd-journald
  ansible.builtin.service:
    name: systemd-journald.service
    state: restarted
