Closed refriedjello closed 2 years ago
as this plugin only imports specific ansible facts that are hard coded, ansible_network_os does not get imported because it is not defined here: https://github.com/Batix/rundeck-ansible-plugin/blob/d1233c4b301f46d3b71070fbecc43b4ac64fc642/src/main/java/com/batix/rundeck/plugins/AnsibleResourceModelSource.java#L357-L404
One would need to make the included ansible facts dynamc. However Rundeck atm can not handle nested data structures like eg.g Disks->Partitions->MetadataOfPatition . It can only handle flat key:value data. Aditionally Ive seen systems with thousands of disks. Rundecks Display of node facts also can not handle this amout of facts.
The Disk Facts are just examples to see whats the issue here. I Think Rundeck itself must allow nested values for nodes as well as a compact, searchable UI that supports thousands of facts.
Fore more Information See #4 #10 #15
See PR #279, as i think it does all you need.
Rundeck 3.0.11 and Ansible 2.7.5 and python 2.7 on CentOS 7.6.1810 to automate tasks on network devices, like Cisco IOS switches.
In Ansible >=2.5 it appears the best method to use is "connection: network_cli" which requires setting the OS type using "ansible_network_os=ios" (for Cisco IOS).
I have that variable declared for my host in my source Ansible inventory file, but it doesn't translate through into Rundeck. Gather Facts under Node Sources doesn't work to auto-determine, since these devices are not servers.
Under a given workflow step I can feed that variable in using "Extra Ansible arguments" and passing "-e ansible_network_os=ios". And that works. But would require setting that on every job, and every job then being OS-specific.
Is there a more elegant way of doing this? I know the OS type ahead of time for everything. Being able to add this info into the source Ansible inventory file seems like the best approach, either per device or using group variables.
Thank you!