Relative Content

Tag Archive for loopsansibleciscofortigate

Ansible looped task executing on non-targeted hosts

I’ve got an Ansible playbook I’m using to do SNMP user operations on Cisco and FortiGates simultaneously. Each task file we’ve written works fine on its own. However, when trying to run at a site level with both types of devices, the playbook breaks. Using a loop for the FortiGate user list, the task “bleeds” over and tries to run on the Cisco devices, which obviously fails, despite a conditional preventing that from happening in the first place. This is running on RHEL 9.4, Ansible 9.7, and Python 3.11.7. host_pinned is the strategy.