Ansible noob - not helpless, just looking for a nudge in the right direction

Right off the bat, I am a total noob to Ansible and relatively new to Python coding as well. With that said I am trying to figure things out on my own before bringing them here to the group. I have a few questions that I hope you can answer for me or at least give me a nudge in the right direction.

I am struggling to understand exactly what modules and plugins Ansible loads, in what order, and why. I see from the documentation where it speaks to the majority of the different plugin types and what they are for, but I can’t seem to find any sort of data flow diagram that answers my questions. Can anyone point me to a definitive source for this information?? I think it will clear up a lot of confusion for me. If I take a Cisco IOS device and execute a playbook against it using ios_facts it seems like Ansible automatically loads the plugins and does so in this order: Action, network_cli, cliconf, then terminal and then ultimately the module. Is this correct? How do the other plugins fit in? I assume different plugins are used depending on the host(s) I need to manage and by what method (shell, cli, etc.)?

Thank you ahead of time for any help you can give.

Dennis

Hi Dennis

Still a newb myself really but these basic details may help?

Playbooks are written in YAML and have a filename extension of .yml

Each Playbook contains 1 or more Plays

Each Play contains 1 or more Tasks

One purpose of Plays is to map Hosts to Tasks.

Tasks are executed in order, one at a time, against all machines matched by the host pattern, before moving on to the next task.

The goal of each task is to execute a Module, with specific arguments. Variables can be used in arguments to modules as well.

This is a link to all the latest modules (v2.8), including IOS:

https://docs.ansible.com/ansible/latest/modules/list_of_all_modules.html

Regards

Phil

Hi, Phil. Thanks for the response. I guess I am familiar with how Ansible works at the level you describe. What I’m looking for is to understand what is going on a bit deeper under the covers. We have all of these plugins that seemingly execute at random times during the playbook run (Action, Cliconf, Terminal, etc.) and I just want to know the order that they execute and then how the output from one can be potentially used as the input for another. Typically you would need to import the classes and functions from one .py into another in order to make use of them, but that doesn’t seem to be happening in the plugins. Are the outputs of the plugins stored in a global memory space for all other plugins to make use of during the playbook execution? Note that I’m referring to the plugins, not the modules - so the stuff that sets up the environment for the modules to actually run successfully.

I may just be asking a stupid question and it’s ok for you all to tell me as much :slight_smile:

Thanks.

Ah, I’d be interested to know the answer myself too then DennisJ

For the end user it doesn't matter what is executed in what order as long as it works.
And for running Ansible from other than the bundled executables you should use Ansible runner
https://github.com/ansible/ansible-runner