--- - block: - name: create tmp.mount.d dir file: path: /etc/systemd/system/tmp.mount.d/ state: directory mode: '0755' register: tmpmnt_directory_state - name: add drop-in fix copy: dest: "/etc/systemd/system/tmp.mount.d/fix-enable.conf" src: "fix-enable.conf" register: fix_enable_conf - name: reload systemd systemd: daemon_reload: yes when: fix_enable_conf is changed - name: enable tmp.mount service: name: tmp.mount enabled: yes when: (ansible_distribution in ["CentOS"] and ansible_distribution_major_version in ["8"]) or (ansible_distribution in ["Fedora"] and ansible_distribution_major_version in ["31"])