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...
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...
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...
We need to search a list of dictionary objects where the key name is dynamic and might have dots (“.”) inside, such as a FQDN hostname.
AAP support using signed SSH certificate as machine credential. Here are example instructions setting it up.
In this case I want to understand how the awx.awx.credential works.
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...
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...
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/...
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.
More examples on using json_query in your playbook.
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...
Ansible Automation Platform Container Groups AAP Container Groups is just like Instance Groups. However, the playbooks will be executed in a pod running in ...
Automation Hub, LDAP and SSO Latest version of Automation Hub does not has built-in LDAP support. Instead it relies on Red Hat SSO to provide integration wi...
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 ...
How to deploy AAP 2.1 on OpenShift from CLI without Cluster Admin privileges (kind of)
How to filter and group VMs using dynamic inventory We would like to pull only certain VMs from our vCenter and put them in different inventory groups. Some ...
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...
Getting this error when running Ansible template task with Python3 in virtual environment or SCL
Find VM IP address when not on the defined VM network We deployed a KVM VM using macvtap connect directly to the physical network and getting a DHCP address....
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 When /home is on a NFS mount, most likely the user home directory is already created from other hosts. Use following steps to a...
Get the list of block devices from facts gathering
How to update text file
How to use Jinja2 inside a playbook
Setup Tower notification for MS Teams
How to setup inventory
Some examples to use the search box in Tower to filter or create smart inventory
How to search events in activtiy stream
How to run tasks on some nodes only
Smart inventory filter examples
How to use different SSH keys for different Git repos
How to launch Tower job using Curl
How to append facts to a dictionary and append it to a list
How to write data from multiple hosts to a single file
How to sort a list of dict objects
How to use user data to setup WinRM on AWS
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 pass variables between job templates in a workflow template
How to launch a job or workflow via REST API call
How to authenticate with server and retrieve a token. Then submit a JSON file via REST API.
How to expand a variables using Jinja2 template
How to cache facts locally when not using Tower
How to use Azure REST API.
How to enable or disable a host during import
How to test connection to host
How to accept EULA when yum installing something?
How to create a virtual NIC on vnet from a different resource group.
Wait until a lock file is removed by other process - name: Wait until lock file is stat: path: "" register: lck_file until: lck_file.stat...
How to replace a substring in variable with regex
How to install a virtual environment with specific versions of Python and Ansible download python-2.7.5 ./configure --prefix=/home/echong/PYTHON-2.7.5 make m...
Start the asynchronous task and check status later ```yaml name: Run sleep shell: sleep 30 async: 30 poll: 0 register: async_output
Replacing multiple lines in file - name: Set some kernel parameters lineinfile: dest: /etc/sysctl.conf regexp: "" line: "" with_items: - ...
Refresh inventory mid play - meta: refresh_inventory
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 check async task status
Lowest precedence to hightest Role default variables Inventory variables Inventory group_vars variables: Inventory host_vars variables: group_vars...
Use | or > sign
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...
# 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...
How to run task only on first node in group
How to set persistent fact in Tower?
How to create a host in Tower via REST API call?
How to set fact on another host?
Where to get markdown language syntax and cheat sheet?
How to add a custom firewall rule to ESXi
Oracle SQLcl sqlformat
Sudoer samples Sources http://www.courtesan.com/sudo/sample.sudoers https://www.sudo.ws/readme.html
How to setup RHEL 8 to run as a kiosk