--- - name: http_client_proxy | Proxy in the global shell environment block: - name: http_client_proxy | Install the proxy environment files ansible.builtin.template: src: "{{ item }}.j2" dest: /etc/profile.d/{{ item }} owner: root group: root mode: "0444" loop: - 10-caching-proxy.sh - 10-java-caching-proxy.sh when: enable_env_proxy - name: http_client_proxy | Remove the proxy environment file if not required ansible.builtin.file: dest: /etc/profile.d/{{ item }} state: absent loop: - 10-caching-proxy.sh - 10-java-caching-proxy.sh when: not enable_env_proxy tags: [systemsetup, proxyenv]