Network to Code is releasing a new Nautobot App, e.g. plugin to interact with Ansible Tower and AWX using the existing Nautobot ChatOps framework! This plugin comes with pre-packaged commands to gather data about your Ansible Tower/AWX environment or to launch a playbook all through chat. Because the Nautobot plugin ChatOps lowers the barrier of entry by providing interactions with chat platforms of Mattermost, Microsoft Teams, Slack, and Webex Teams, the amount of code needed to generate chatops commands is low. This is just the start of the additional components that can be expected to be integrated with over time using Nautobot. You can also extend the bot creating any additional commands (and contribute them back, of course!).
Putting into a diagram, this is a companion plugin to the Nautobot ChatOps plugin. Looking at the diagram below, the chat application will interact with a URL to Nautobot, which then passes it to the code in the Nautobot ChatOps Ansible plugin. From there the Ansible ChatOps code is charged with interacting with Ansible Tower and passing the data back through Nautobot ChatOps, which handles responding back to the user.
The Nautobot ChatOps Ansible plugin extends the capabilities of the Nautobot ChatOps plugin to include a new command available to the plugin. This is done by registering to the Python entry point in Nautobot plugin ChatOps, that provides functionality to the code written to interact with Ansible. This plugin introduces the following sub-commands to the ansible
command:
The dashboard command provides an Ansible Tower/AWX status dashboard. This gives a summary of:
The inventory sub-command provides inventories available and the details of those inventories.
Get projects will gather information about the projects available within the Ansible Tower/AWX instance. Information such as the name, description, SCM URL, and SCM branch are provided.
This gathers the information about the defined job templates on the Ansible Tower/AWX instance. It will provide the name, description, project, and the associated inventory with the Job Template configured. It will provide the name, description, project, and the associated inventory for the selected Job Template.
The natural progression of gathering job templates is then to execute a particular job template. Executes a Job Template that does not require extra vars or surveys to be completed. The Job ID for the executed job template will be provided via a chat response. The URL to the Job execution will also be provided as the text response.
The get jobs sub-command will ask Tower for the last number of jobs, with a default count of the last 10 jobs. This will give the status of the jobs including:
This is just the start of what is capable with extending the Nautobot ChatOps ecosystem. Whether you want to write your own, or use one of the additional plugins that has been created by Network to Code, the ecosystem for ChatOps is going to continue to grow! Keep an eye out for additional ChatOps plugins to be announced here!
Share details about yourself & someone from our team will reach out to you ASAP!