- become: true tags: - trygvis-base - trygvis-base-misc block: - name: /etc/localtime when: trygvis_base__etc_localtime file: src: /usr/share/zoneinfo/Europe/Oslo dest: /etc/localtime state: link force: yes notify: reconfigure tzdata - name: remove ~root/.ssh/authorized_keys when: trygvis_base__remove_root_authorized_keys file: path: ~root/.ssh/authorized_keys state: absent - name: /etc/hosts when: trygvis_base__fix_hosts copy: dest: /etc/hosts content: | 127.0.0.1 localhost 127.0.1.1 {{ ansible_hostname }}.trygvis.io {{ ansible_hostname }} ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters - name: stat /etc/aliases register: etc_aliases stat: path: /etc/aliases - name: /etc/aliases when: trygvis_base__fix_aliases and etc_aliases.stat.exists notify: postalias /etc/aliases lineinfile: path: /etc/aliases regexp: "^root:" line: "root: root@trygvis.no" - become: true tags: - trygvis-base - trygvis-base-syslog when: trygvis_base__syslog block: - vars: items: - rsyslog apt: name: "{{ items }}" state: present install_recommends: no - become: true tags: - trygvis-base - trygvis-base-journald when: trygvis_base__journald block: - stat: path: /var/log/journal register: journal_log - when: not (journal_log.stat.isdir is defined and journal_log.stat.isdir) file: path: /var/log/journal state: directory notify: reload journalctl - when: not (journal_log.stat.isdir is defined and journal_log.stat.isdir) command: /bin/systemd-tmpfiles --create --prefix /var/log/journal notify: reload journalctl