Ansible

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

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...

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...

Back to top ↑

ansible

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...

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/...

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 ...

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...

Back to top ↑

aap

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...

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...

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 ↑

Tower

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 search on Tower

1 minute read

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

Back to top ↑

inventory

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...

Back to top ↑

tower

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...

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...

Back to top ↑

set_fact

Back to top ↑

container

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 ↑

REST

Back to top ↑

RegEx

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: - ...

Back to top ↑

job

Back to top ↑

json_query

Back to top ↑

linux

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 ↑

certificate

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...

Back to top ↑

yaml

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 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...

Back to top ↑

async_status

Back to top ↑

virtual environment

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...

Back to top ↑

Python

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...

Back to top ↑

lineinfile

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: - ...

Back to top ↑

blockinfile

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: - ...

Back to top ↑

filter

Back to top ↑

Azure

Back to top ↑

Jinja2

Back to top ↑

dictionary

Back to top ↑

list

Back to top ↑

VMware

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.

Back to top ↑

jinja2

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...

Back to top ↑

docker

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 ↑

podman

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 ↑

python

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.

Back to top ↑

satellite

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/...

Back to top ↑

pah

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

Back to top ↑

hub

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

Back to top ↑

markdown

Markdown cheatsheet

less than 1 minute read

Where to get markdown language syntax and cheat sheet?

Back to top ↑

regex_replace

Back to top ↑

stat

Back to top ↑

loop

Back to top ↑

yum

Back to top ↑

wait_for_connection

Back to top ↑

Cloud

Back to top ↑

fact

Back to top ↑

lookup

Back to top ↑

token

Back to top ↑

AWS

Back to top ↑

Windows

Back to top ↑

WinRM

Back to top ↑

curl

Back to top ↑

SSH

Back to top ↑

Git

Back to top ↑

smart inventory

Back to top ↑

activity stream

Back to top ↑

invenory

Back to top ↑

notification

Back to top ↑

Microsoft Teams

Back to top ↑

ESXi

Back to top ↑

firewall

Back to top ↑

Oracle

Back to top ↑

SQLcl

Back to top ↑

SQL

Back to top ↑

facts

Back to top ↑

user

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...

Back to top ↑

vm

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.

Back to top ↑

libvirt

Back to top ↑

kvm

Back to top ↑

virsh

Back to top ↑

sudo

Sudo Samples

3 minute read

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

Back to top ↑

unix

Sudo Samples

3 minute read

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

Back to top ↑

selinux

Back to top ↑

vcenter

Back to top ↑

vmware

Back to top ↑

rhel

Back to top ↑

kiosk

Back to top ↑

openshift

Back to top ↑

operator

Back to top ↑

ee

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 ↑

execution environment

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 ↑

Automation Hub

Back to top ↑

LDAP

Back to top ↑

OpenLDAP

Back to top ↑

OpenShift

Back to top ↑

mesh

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...

Back to top ↑

aws

Back to top ↑

jq

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.

Back to top ↑

foreman

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/...

Back to top ↑

winrm

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...

Back to top ↑

windows

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...

Back to top ↑

debug

Back to top ↑

vscode

Back to top ↑

ssh

Back to top ↑

selectattr

Back to top ↑

shell script

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 ↑

ansible collection

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...

Back to top ↑

ansible module

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...

Back to top ↑

kerberos

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...

Back to top ↑

postgresql

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...

Back to top ↑

database

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...

Back to top ↑

idm

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...

Back to top ↑

collection

Back to top ↑