--- # If the user installs GNU sed through homebrew the path is different. - name: Register path to sed. command: which sed register: sed_which_result changed_when: false when: sed_path is undefined - name: Define sed_path variable. set_fact: sed_path: "{{ sed_which_result.stdout }}" when: sed_path is undefined # Sudoers configuration. - name: Copy sudoers configuration into place. copy: content: "{{ sudoers_custom_config }}" dest: /private/etc/sudoers.d/custom mode: 0440 validate: 'visudo -cf %s' become: true