We will start this module by highlighting the Ansible Tower best practices
that you should adopt in enterprise, such as autoscaling and provisioning
callback feature. We will address Ansible Tower and the Jenkins integration
that drives consistency within the enterprise.
We will also examine how you may use Ansible surveys,
schedules,
notifications that are easy to perform but considered advanced Tower use
cases. At the end of the module, we will address Ansible Tower clustering
that is suited for larger enterprise environments.
There will be two demos in this module. Firstly, we will set up a
survey, and then we'll look at how to configure notifications and
job scheduling. As a best practice, you should try to store Ansible
objects such as playbooks, roles, and any associated details in Source Control.
This allows Tower users to manage the changes and keep track of
every modification by providing an audit trail.
Doing so allows you to adopt software development mythologies, which
are key to creating a scalable automation model.
Always test configurations and playbooks before you push them to production.
In addition, build a dev environment, and not just
a free‑for‑all dev environment,
but try to keep this environment as close to the production as possible.
In these testing environments, you can test your playbooks. So in Ansible Tower,
we have a check feature that is similar to a dry run in Ansible Core. Using
the check feature along with role‑based access control is recommended so
lesser technical teams or team members that don't need the full requirements
can quickly do sanity checks. So Ansible lets you insert as many checks and
balances into your upgrade workflows, such as checking for security patches
and deviations from baselines.
Tower enables automated testing extremely easy.
Automated testing can be performed and provisioned in
environments within one or more playbook runs,
for example,
Jenkins integration, and automated testing enables consistency of all stages.
Before moving to deployment and into production, test environments can be
quickly provisioned and deployed 100% from scratch,
improving your ability to test and speed up the
application to production delivery.
So Jenkins can act as an orchestrator and kick off Ansible
playbooks to provision application environments and deploy the
latest code as part of the Jenkins CI job.
A recommended integration is to have Ansible Tower used in the CI/CD process
to provision target environment and deployed application.
Autoscaling enables infrastructure to scale automatically
with increases and decreases in demand.
Ansible Tower has a provisioning callback mechanism that allows newly
created hosts to request an Ansible Tower configuration run.
Therefore, newly booting instances can request configuration,
which is useful for autoscaling scenarios in cloud environments and
provisioning integration. So what inventory is considered a source of
truth for your environment and describes the targets that you want to
manage? With Ansible Tower,
we have a variety of inventories that can suit your
environmental requirements, and we can even filter down to be
specific on what you want in your inventory based on
discoverable variables known as Ansible facts.
Smart inventories allow you to build inventories based on a filter
so the filter can relate to an Ansible fact,
such as a particular OS distribution, allowing very customized inventories.