I have 100 devices in host file, both IOS and NXOS mixed. I am trying pull OS details and hostname as report. Since IOS and NXOS devices are mixed in inventory, How can IOS_facts and NXOS_facts work in single playbook when there is no group in inventory.
I have only one group in inventory(both IOS and NXOS)
I don’t think this is possible to achieve if you can only set ansible_network_os to ios. The *_facts (or any network module with connection: network_cli) is dependent on the correct cliconf and terminal plugins being loaded which is identified by ansible_network_os value.
Since your target devices are restricted to IOS and NX-OS which share similarities in CLI structure, you can possibly do something like the following. However, this is not recommended at all and is not guaranteed to work. The correct approach is to fix your inventory and group the target hosts properly.