--- - name: Include OS-specific variables include_vars: "{{ item }}" with_first_found: - files: - "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml" - "{{ ansible_os_family }}.yml" # tasks file for cronie - name: Install cronie package: name="{{cronie_package}}" state=present become: yes - name: Enable cronie service: name="{{cronie_service_name}}" enabled=yes state=started become: yes - name: ensure root cron file exist file: path: /var/spool/cron/root mode: 0600 # not required. Mode the file or directory should be. For those used to I(/usr/bin/chmod) remember that modes are actually octal numbers. You must either add a leading zero so that Ansible's YAML parser knows it is an octal number (like C(0644) or C(01777)) or quote it (like C('644') or C('1777')) so Ansible receives a string and can do its own conversion from string into number. Giving Ansible a number without following one of these rules will end up with a decimal number which will have unexpected results. As of version 1.8, the mode may be specified as a symbolic mode (for example, C(u+rwx) or C(u=rw,g=r,o=r)). state: "touch" become: true - name: Set MAILFROM become: true lineinfile: dest: /var/spool/cron/root regexp: "MAILFROM=" line: "MAILFROM= {{inventory_hostname}}@{{domain.name}}"