--- - 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: enable tmp.mount systemd: daemon_reload: yes masked: no 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"])