Closed SoundGoof closed 2 months ago
Same issue on my side, the workaround is working but not solving the problem as i also need different proxy settings depending on the fortigate to contact.
ansible [core 2.11.12]
Collection Version
ansible.netcommon 5.1.0 fortinet.fortios 2.2.3
It looks like to be a "by-design" issue. https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_environment.html#setting-the-remote-environment
The environment: keyword does not affect Ansible itself, Ansible configuration settings, the environment for other users, or the execution of other plugins like lookups and filters.
and httpapi fall into that category like other plugin, its part of Ansible.
Verified with this example playbook:
---
- name: xxx
hosts:
- xxx
gather_facts: True
collections:
- fortinet.fortios
vars:
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: True
ansible_httpapi_validate_certs: False
ansible_httpapi_use_proxy: True
ansible_network_os: fortinet.fortios.fortios
ansible_network_import_modules: False
connection: httpapi
environment:
XXX: "YYY"
tasks:
- name: debug
debug:
msg: "{{ lookup('pipe', 'env') }}"
environment:
XXX: "YYY"
Output does not show any XXX variable.
Hi
We unable to use proxy when trying to change password on a fortigate firewall the problem we are facing is that we have different proxy servers depending on which fortigate firewall we want to access
the only way we got it working was to export a HTTPS_PROXY variable on the ansible-server looking at tcpdump the traffic tries to go directly to the firewall unless the export is done beforehand
fortigate.yaml file
inventory.yaml