Automation with ansible along with industry use cases:

Firstly we need to understand why we need automation in the IT industry??
And why only ansible is used widely in the Industries??
🧐🧐🤔🤔
We all don’t like to perform the same tasks again and again while doing any projects,tasks,etc. We hate resolving the same errors which we had already resolved a week ago🤐🤐
We wish that without repeating the task we can resolve our problems in the Industry. So, to avoid these repeated tasks we need automation that can easily in just one click can resolve our errors and other work like creating a similar file multiple times in different OS/servers,executing the same commands n number of times,etc .
Automation also gives us relief from remembering a tons of commands. We can have a single file which will contain all the necessary commands required for performing a particular configuration on particular OS/servers.
As an IT guy we open cmd prompt and install the required OS by using some cmd and this command varies from OS to OS. For linux it’s different,for windows installation cmd varies from others.So it’s a very frustrating task to install and then configure the OS separately for each requirement of the customers ☹️☹️☹️
This installations and along with configuration can be easily done by
Ansible😌
But why only ansible??🤔🤔
Ansible does not only supports the automation it has some unique features which makes it to stand different from other automation tools.
For automation from ages we are using the scripts written in languages like python,perl,Ruby on rails,etc. But these scripts have a drawback. They use imperative language i.e to run the code we nees to specify the script what to do means what to automate and how to do means how to perform that task.
Here in how to do the task we need to specify the OS respective commands version wise e.g for Red hat Linux ver 6 we need to specify different cmds as compared to Red hat Linux ver 8 because both do not support same commands.
But in ansible we only need to specify- what to do i.e what we have to automate, because it’s a declarative language. How to do that task with OS respective commands is automatically handled by ansible . And so ansible has a very much demand in the market and Industry.
Below diagram shows the working of ansible.

So now that everyone understood why we nees ansible. Now I would like you to get acquainted with the real industry use cases of the ansible.
Industry actually uses the ansible tower in their works. Ansible tower is built on top of ansible.
I would like to share the industry use case which I learned from the workshop organised by Linux World and presented by two great personalities —
Shreejith Anujan and Arun Eapen

Both of them demonstrated and explained the use cases very nicely.☺️😊😇👏👏
Industry mainly uses ansible tower to perform their work.
Think 💭💭💭
what would happen if the control node of ansible which manages the entire automation suddenly crashes or stops working🤔🥺😳😳
Here the role of Ansible Tower comes.
Because ansible tower works in a clustered environment that shares the same database . No worries if any one OS crashes the other can continue with the work.
Ansible Tower:
Ansible Tower is Ansible at an enterprise level. It is a web-based solution for managing your organization with a very easy user interface that provides a dashboard with state summaries of all the hosts, allows quick deployments, and monitors all configurations. Ansible Tower is a REST API, web service, and web-based console designed to make Ansible usable for IT teams. It is a hub for automation tasks. Tower allows you to share SSH credentials without exposing them, log all jobs, manage inventories graphically, and sync them with a wide variety of cloud providers.

Ansible Tower has much more features and usecases :
YOUR ANSIBLE DASHBOARD

The Ansible Tower dashboard provides a heads-up NOC-style display for everything going on in your Ansible environment.
As soon as you log in, you'll see your host and inventory status, all the recent job activity and a snapshot of recent job runs. Adjust your job status settings to graph data from specific job and time ranges.
✔️ REAL-TIME JOB STATUS UPDATES

Within Ansible Tower, playbook runs stream by in real time. As Ansible automates across your infrastructure, you’ll see plays and tasks complete, broken down by each machine, and each success or failure, complete with output. Easily see the status of your automation, and what’s next in the queue.
Other types of jobs, such as source control updates or cloud inventory refreshes, appear in the common job view. Know what Ansible Tower is up to at any time.
✔️LAUNCH INSTANCE ON CLOUD:
Using ansible tower we can launch the instance in the cloud. Here we need the respective cloud platform credentials to connect to the cloud platform e.g AWS,azure,GCP , etc.
✔️ MULTI-PLAYBOOK WORKFLOWS

Ansible Tower Workflows allow you to easily model complex processes with Ansible Tower’s intuitive workflow editor. Ansible Tower workflows chain any number of playbooks, updates, and other workflows, regardless of whether they use different inventories, run as different users, run at once or utilize different credentials.
You can build a provisioning workflow that provisions machines, applies a base system configuration, and deploys an application, all with different playbooks maintained by different teams. You can build a CI/CD testing workflow that builds an application, deploys it to a test environment, runs tests, and automatically promotes the application based on test results. Set up different playbooks to run in case of success or failure of a prior workflow playbook.
✔️ WHO RAN WHAT JOB WHEN

With Ansible Tower, all automation activity is securely logged. Who ran it, how they customized it, what it did, where it happened - all securely stored and viewable later, or exported through Ansible Tower’s API.
Activity streams extend this by showing a complete audit trail of all changes made to Ansible Tower itself - job creation, inventory changes, credential storage, all securely tracked.
All audit and log information can be sent to your external logging and analytics provider to perform analysis of automation and event correlation across your entire environment.
✔️ SCALE CAPACITY WITH TOWER CLUSTERS

Connect multiple Ansible Tower nodes into a Ansible Tower cluster. Ansible Tower clusters add redundancy and capacity, allowing you to scale Ansible automation across your enterprise, including with reserved capacity for certain teams and jobs, and remote execution for access across network zones. Current Ansible Automation architecture can scale to 200K nodes with 20 cluster nodes.
Ansible Tower now available as a clusterable container service in Red hat OpenShift.
✔️ INTEGRATED NOTIFICATIONS

Stay informed of your automation status via integrated notifications. Notify a person or team when your job succeeds, or escalate when jobs fail. Send notifications across your entire organization at once, or customize on a per-job basis.
Connect your notifications to Slack, Hipchat, PagerDuty, SMS, email, and more - or post notifications to a custom webhook to trigger other tools in your infrastructure.
✔️ SCHEDULE ANSIBLE JOBS

Playbook runs, cloud inventory updates, and source control updates can be scheduled inside Ansible Tower - run now, run later, or run forever.
Set up occasional tasks like nightly backups, periodic configuration remediation for compliance, or a full continuous delivery pipeline with just a few clicks.
✔️ MANAGE AND TRACK YOUR ENTIRE INVENTORY

Ansible Tower helps you manage your entire infrastructure. Easily pull your inventory from public cloud providers such as Amazon Web Services, Microsoft Azure, and more, or synchronize from your local OpenStack cloud or VMware environment. Connect your inventory directly to your Red Hat Satellite or Red Hat CloudForms environment, or your custom CMDB.
Ansible Tower can keep your cloud inventory in sync, and Ansible Tower's powerful provisioning callbacks allow nodes to request configuration on demand, enabling autoscaling. You can also see alerts from Red Hat Insights directly from Ansible Tower, and use Insights-provided Playbook Remediation to fix issues in your infrastructure.
Plus, Ansible Tower Smart Inventories allow you to organize and automate hosts across all your providers based on a powerful host fact query engine.
✔️ SELF-SERVICE IT... SIMPLIFIED

Ansible Tower lets you launch playbooks with just a single click. It can prompt you for variables, let you choose from available secure credentials and monitor the resulting deployments.
Ansible Tower's simplified portal mode and survey features allow IT administrators to delegate automation job runs to users across the organization - synchronized directly from corporate directories such as LDAP, Active Directory or delegated SAML authentication.
With Ansible Tower delegation, developers or QA departments can provision their own dev and test environments. Customer service agents can provision a new demo environment. Or junior admins can run simple jobs - like changing passwords - all at the press of a button.
✔️ ORACLE CLOUD INFRASTRUCTURE
SDKs and CLI require basic configuration information, like user credentials and tenancy OCID. You can provide this information by:
- Using a configuration file
- Declaring a configuration at runtime
Ansible AWX makes it easy to run and manage your Oracle Cloud Infrastructure using the Ansible Modules Collection. This collection was released in 2020 and highlighted in Latest Updates on Oracle Ansible Modules and Comparison with Terraform. It supports all OCI services, and it has an inventory plugin that you can use to query the Compute instances and the database instances.
Ansible AWX makes it easy to run and manage your Oracle Cloud Infrastructure using the Ansible Modules Collection. This collection was released in 2020 and highlighted in Latest Updates on Oracle Ansible Modules and Comparison with Terraform. It supports all OCI services, and it has an inventory plugin that you can use to query the Compute instances and the database instances.
The OCI collection depends on the OCI Python SDK to run. To install the SDK, you have the following options:
- Create a tower virtual environment and use it when running the playbooks.
- Use a playbook to install the SDK in the current environment.
Virtual Env with ansible tower:
Virtualenv creates isolated Python environments to avoid problems caused by conflicting dependencies and differing versions. Virtualenv works by simply creating a folder which contains all of the necessary executables and dependencies for a specific version of Python. Ansible Tower creates two virtualenvs during installation–one is used to run Tower, while the other is used to run Ansible. This allows Tower to run in a stable environment, while allowing you to add or update modules to your Ansible Python environment as necessary to run your playbooks.
These are some of the usecases of the ansible as used in industries.
I hope everyone liked this article.😌😌