Awx.awx.project

0 views
Skip to first unread message

Irmgard Rossie

unread,
Jul 30, 2024, 10:47:37 PM7/30/24
to leobesttownthing

Since automation controller is exposing all of its functionality via REST API, we can automate everything. Instead of using the API directly, it is highly recommended to use the AWX or automation controller Ansible Collection (the second link will only work for you, if you have an active Red Hat Ansible Automation Platform Subscription) to setup, configure and maintain your Red Hat Ansible Automation Platform Cluster.

awx.awx.project


DOWNLOAD ✦✦✦ https://perdigahiara.blogspot.com/?ldf=2zToaA



For the purpose of this lab, we will use the community AWX collection. Red Hat Customers will prefer the supported Ansible automation controller collection. Since this requires an active subscription and we want to make the lab usable for everyone, we will stick to the AWX collection for the purpose of the lab.

Make sure you define the environment variables in the same shell you want to later run your Ansible Playbook from, otherwise the Playbook will fail due to authentication errors. If you lost connection to VSCode, just source the set-connection.sh file again.

Since we are calling the REST API of automation controller, the Ansible Playbook is run against localhost, but the module will connect to the URL provided by the CONTROLLER_HOST environment variable you set above.

Now that we have the empty inventory created, extend the Playbook to add your three managed hosts using their internal hostnames node1..internal and node2..internal and node3..internal, again using the AWX Ansible Collection. The module to add hosts to an inventory is called awx.awx.host.

SSH keys have already been created and distributed in your lab environment and sudo has been setup on the managed hosts to allow password-less login. When you SSH into a host as user lab-user from bastion..internal you will become user ec2-user on the host you logged in.

The next step is to configure credentials to access our managed hosts. The private key for lab-user is stored in /home/lab-user/.ssh/key.pem and already configured on the managed nodes. Try to find the necessary attributes in the awx.awx.credential module documentation or use the solution provided and add this to the Playbook.

The Ansible content used in this lab is hosted on Github in the project -labs-crew/playbooks_adv_summit2021.git. The next step is to add a project to import the Ansible Playbooks. As before, try to figure out the necessary parameters by reading the documentation of the awx.awx.project module documentation.

Before running an Ansible Job from your automation controller cluster you must create a Template, again business as usual for automation controller users. For this part of the Ansible Playbook, we will use the awx.awx.job_template module. The name of the Ansible Playbook you want run is apache_install.yml.

Have a look around, everything we automatically configured on one controller instance with our Ansible Playbook was synchronized automatically to the other nodes. Inventory, credentials, projects, templates, all there.

93ddb68554
Reply all
Reply to author
Forward
0 new messages