--- - name: Check if {{SlurmAccountingDir}}/accounting.txt when: PrimaryController|bool stat: path: "{{SlurmAccountingDir}}/accounting.txt" register: result - name: Create {{SlurmAccountingDir}}/accounting.txt when: PrimaryController|bool and not result.stat.exists file: path: "{{SlurmAccountingDir}}/accounting.txt" state: touch owner: slurm group: slurm mode: 0755