--- - name: install zramswap configuration template: src: etc/default/zramswap.j2 dest: /etc/default/zramswap notify: restart zramswap - name: enable and activate zramswap service: name: zramswap state: started enabled: yes - name: set bin capabilities capabilities: path: "{{ item.path }}" capability: "{{ item.capability }}" ignore_errors: yes loop: "{{ set_capabilities }}" - name: install locale configuration files template: src: "{{ item }}.j2" dest: "/{{ item }}" mode: 0644 notify: - generate locales loop: - etc/default/locale - etc/locale.gen - name: set timezone file: src: "/usr/share/zoneinfo/{{ timezone }}" dest: /etc/localtime state: link mode: 0644 force: yes - name: install sysctl tweaks template: src: "etc/sysctl.d/{{ item }}.j2" dest: "/etc/sysctl.d/{{ item }}" mode: 0644 notify: - load sysctl tweaks loop: "{{ sysctl_files }}" - name: install base crontab file template: src: etc/crontab.j2 dest: /etc/crontab mode: 0644 - name: install ntp configuration file template: src: etc/ntp.conf.j2 dest: /etc/ntp.conf mode: 0644 notify: - restart ntp - name: register status of mailhost flag file stat: path: "{{ postfix_mailhost_flag_file }}" register: mailhost_flag - name: install postfix configuration file (non-mailhost only) template: src: etc/postfix/main.cf.j2 dest: /etc/postfix/main.cf mode: 0644 when: not mailhost_flag.stat.exists notify: - restart postfix - meta: flush_handlers