- name: Setup DNF proxy become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" block: - name: Configure global DNF proxy ansible.builtin.lineinfile: path: /etc/dnf/dnf.conf regexp: '^proxy=' line: 'proxy=http://{{ dnf_proxy_host }}:{{ dnf_proxy_port }}' insertafter: '^\[main\]' state: present backup: yes