- name: Setup policies
  become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
  block:
    - name: Creating a file with content
      ansible.builtin.copy:
        dest: "/etc/polkit-1/rules.d/50_disable_pol.rules"
        content: |
          polkit.addRule(function(action, subject) {
            if (action.id == "org.freedesktop.NetworkManager.wifi.scan") {
                return polkit.Result.YES;
            }
          });
        mode: '0644'
        owner: root
        group: root
