- name: proxy or not proxy debug: var: proxy - name: block disable proxy block: - name: add proxy.sh file copy: src: os/proxy.sh dest: /etc/profile.d/proxy.sh - name: remove line proxy in yum.conf lineinfile: path: /etc/yum.conf insertafter: EOF line: proxy=http://ville-geneve.ch:8080 when: proxy|bool # block - name: block disable proxy block: - name: delete proxy.sh file file: path: /etc/profile.d/proxy.sh state: absent - name: remove line proxy in yum.conf lineinfile: path: /etc/yum.conf regexp: '^proxy' state: absent when: not proxy|bool # block