订阅内容

5 things you didn’t know your Red Hat Ansible Automation Platform could do

5 things blog post

When we think about automation, we tend to focus on efficiency. Automating simple or even complex tasks to streamline our processes - It’s one of the reasons organizations adopt and implement Red Hat Ansible Automation Platform. 

But what if we can take our automation abilities to the next level?

In this blog post, I’m going to highlight 5 things you didn’t know your Ansible Automation Platform could do.

Callback Plugins

Ever need a job to notify you, log events, or capture the performance of a playbook?

Say hello to callback plugins. These plugins provide a way for Ansible to respond to particular events. In order to enable callback plugins, you'll need to tweak your job settings and supply the directory location in the Ansible callback plugins section. 

For example, the log_plays callback plugin records playbook events to a log file, while the mail callback plugin can send emails on playbook failures. 

A list of available callback plugins can be found within the Ansible documentation

JSON Output

Looking for an easy way to view your Ansible output in JSON format? Take advantage of the Ansible API.

When a job runs within Ansible Automation Platform, it contains a job ID.

If you visit the job events URL for that particular job ID (https://<controller-server-name>/api/v2/jobs/<job_id>/job_events), you get instant access to your playbook output in JSON format!

Dynamic Inventories

Do you ever use a dynamic inventory but only need to access a few servers from the list?

Use the Limit field within your Job templates. This ensures that only the specific host(s) or group(s) specified within the Limit field apply to your Ansible Job.

For example, if I want to make only changes to webservers and dbservers groups, add webservers:dbservers in the Limit field within your Ansible Job Template.

 

Managing the lifecycle of a containerized application via Git

One of the great things about Ansible Automation Platform is how it can integrate with other tools. This is especially useful when you integrate Ansible Automation Platform with GitHub Webhooks. 

When you combine GitHub Webhooks and Ansible workflows, you can trigger changes to your application automatically. 

A perfect scenario for this is when you're running containerized apps at the Edge but want an automated way to manage those apps.

Here is a YouTube video I made on managing the lifecycle of a Podman container

Improving Execution Time on Large-Scale Jobs

Running a job on 1000s of servers and it’s taking forever to complete?Increase your forks!

Forks are used to determine how many hosts to automate against in parallel (default is 5). But be careful not to overcommit the value!

One way to ensure you don’t overcommit is checking your Capacity Adjustment value. Within Instance Groups -> <Your Group> -> Instances, under Capacity Adjustment you’ll see what each server on that group can handle.

Optimizing Execution Performance with Multiple Nodes and Job Slicing

Do you have multiple execution nodes in your Ansible Automation Platform environment? Combine the increasing of forks with job slicing!

Job slicing breaks a job (“slices”) and places a slice per execution node. It allows you to split a single job to run across multiple execution nodes providing faster performance.

And there you have it! 5 things to take your automation to the next level!

I hope you found these top 5 tips valuable in discovering new ways to leverage the power of Ansible Automation Platform.

What can I do next?

Whether you are beginning your automation journey or are a seasoned veteran, there are a variety of resources to enhance your automation knowledge.


关于作者

UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Original series icon

原创节目

关于企业技术领域的创客和领导者们有趣的故事