2024

Back to top ↑

2023

Automation Hub Private Repository

1 minute read

Background We want to allow users to create they own collection under company namespace, but not sharing with the rest of the Hub users

Use Kerberos for AAP PostgreSQL Connection

2 minute read

We have Red Hat Identity Management (IdM) setup in the lab to provide Kerberos authentication. This how-to will demonstrate setting up AAP to connect to its...

Using the ansible.controller credential module

1 minute read

The awx.awx.credential or ansible.controller.credential cannot see the secret value of existing credential, so it compares other fields in the inputs to dete...

Launch AAP job via REST API

1 minute read

We want to launch AAP job from shell script. The job template has Limit, Instance Groups and Variables set with Prompt on launch enabled, so users can provi...

Back to top ↑

2022

Setup AAP Controller to trust a CA cert

less than 1 minute read

AAP Controller does not read system PKI directory. So adding CA cert to /etc/pki/ca-trust/source/anchors directory and run update-ca-trust is not enough. I...

Use signed certificate for WinRM

1 minute read

WinRM setup default create a self-signed certificate for the HTTPS transport. We have to set ansible_winrm_server_cert_validation: ignore to avoid getting S...

Ansible Foreman Inventory Plugin Filters

less than 1 minute read

The Ansible Foreman inventory plugin import all hosts by default. It can also be filtered to only import certain hosts. The filter plugin uses the Foreman/...

Parse YAML with jq

less than 1 minute read

We want to parse YAML file with jq command like JSON file. Following snippet will use Python to convert YAML file to JSON format and pass to jq command.

How to visualize your Automation Mesh layout

2 minute read

Automation Mesh is a new feature that replace Isolated node. Instead of just directly connecting the Tower nodes to Isolated nodes via SSH, we can have diff...

How to create a new execution environment

2 minute read

Build a new EE image We would like to use a third part collection, in this case community.efficientip and community.crypto, in our playbooks. The collection ...

Back to top ↑

2021

Ansible Variables Precedence Gotcha

1 minute read

I recently got tripped by Ansible variables precedence. We are familiar with the precedence concept. Sometime in a complex playbooks, it help to remember ho...

Sudo Samples

3 minute read

Sudoer samples Sources http://www.courtesan.com/sudo/sample.sudoers https://www.sudo.ws/readme.html

Back to top ↑

2020

Find VM with the same name

less than 1 minute read

Find VM with the same name We want to make sure the VM only exists in the folder we want or not exists at all.

Create user with shared home

less than 1 minute read

Create user with shared home When /home is on a NFS mount, most likely the user home directory is already created from other hosts. Use following steps to a...

How to search on Tower

1 minute read

Some examples to use the search box in Tower to filter or create smart inventory

Back to top ↑

2019

Some useful magic variables

less than 1 minute read

It is just magic role_name : current role name role_names : list of roles in current play groups : list of groups and their hosts inventory_hostname...

Back to top ↑

2018

How to replace multiple lines in file

less than 1 minute read

Replacing multiple lines in file - name: Set some kernel parameters lineinfile: dest: /etc/sysctl.conf regexp: "" line: "" with_items: - ...

How to use virtualenv Python on localhost

less than 1 minute read

Force to use virtualenv python When running modules that require virtualenv, such as Azure, local_action or localhost connection sometimes still use the de...

How to determine variable precedence

less than 1 minute read

Lowest precedence to hightest Role default variables Inventory variables Inventory group_vars variables: Inventory host_vars variables: group_vars...

How to check yaml syntax

less than 1 minute read

Using python yaml module python -c 'import yaml, sys; print yaml.load(sys.stdin);' < my_playbook.yml If no syntax error exists, Python prints the content...

How to call groups in the inventory

less than 1 minute read

# To see all hosts in the inventory ansible all -i inventory --list-hosts ansible '*' -i inventory --list-hosts To see all hosts by wild cards ansible '*.ex...

Markdown cheatsheet

less than 1 minute read

Where to get markdown language syntax and cheat sheet?

Back to top ↑