---
  - name: Applying general UI/UX settings
    shell: "{{ item }}"
    with_items: osx_ui_settings

  - name: Applying input settings
    shell: "{{ item }}"
    with_items: osx_input_settings

  - name: Applying sharing settings
    shell: "{{ item }}"
    with_items: osx_sharing_settings

  - name: Applying screen settings
    shell: "{{ item }}"
    with_items: osx_screen_settings

  - name: Applying finder settings
    shell: "{{ item }}"
    with_items: osx_finder_settings

  - name: Applying dock settings
    shell: "{{ item }}"
    with_items: osx_dock_settings

  - name: Applying safari settings
    shell: "{{ item }}"
    with_items: osx_safari_settings

  - name: Check if /etc/exports exists
    stat:
      path: /etc/exports
    register: nfs_exports

  - name: Create /etc/exports if it doesn't exists
    sudo: yes
    file:
      path: /etc/exports
      state: touch
      mode: 0644
    when: nfs_exports.exists is not defined

---
  - name: Applying general UI/UX settings
    shell: "{{ item }}"
    with_items: osx_ui_settings

  - name: Applying input settings
    shell: "{{ item }}"
    with_items: osx_input_settings

  - name: Applying sharing settings
    sudo: yes
    shell: "{{ item }}"
    with_items: osx_sharing_settings

  - name: Applying screen settings
    shell: "{{ item }}"
    with_items: osx_screen_settings

  - name: Applying finder settings
    shell: "{{ item }}"
    with_items: osx_finder_settings

  - name: Applying dock settings
    shell: "{{ item }}"
    with_items: osx_dock_settings

  - name: Applying safari settings
    shell: "{{ item }}"
    with_items: osx_safari_settings

  - name: Check if /etc/exports exists
    stat:
      path: /etc/exports
    register: nfs_exports

  - name: Create /etc/exports if it doesn't exists
    sudo: yes
    file:
      path: /etc/exports
      state: touch
      mode: 0644
    when: nfs_exports.exists is not defined

Use sudo rights when changing computer name
Use sudo rights when changing computer name
