In this lab, you will employ Red Hat Ansible Tower to put into effect the play you pushed to ansible-generic Git repository.
Outcomes
You should be able to:
Employ an existing inventory in Red Hat Ansible Tower (the lab.example.com inventory you created in Lab 4).
Create Credentials in Red Hat Ansible Tower to support the project.
Create a Project in Red Hat Ansible Tower
Create a Job Template in Red Hat Ansible Tower.
Execute the Job Template.
Open a web browser window on the workstation VM.
Log in to http://tower.lab.example.com as admin using student as the password.
Instructions
Perform the following steps:
Temporarily remove the line vault_password_file = ../.rhv/vault-secret from your ansible.cfg file then commit your work to the Git repository.
Create Credentials in Red Hat Ansible Tower to support the project.
Create a Credential named vyos-access that provides administrative access to VyOS devices as user vyos with password vyos.
The Credential type is Machine.
Create a Credential named student-scm that provides read access to the ansible-generic-project Git repo as user student with password student.
The Credential type is Source Control.
Create a Project in Red Hat Ansible Tower named vyos-hn-dn-ns.
The project should have SCM Type of Git, and be configured with SCM source URL of http://git.lab.example.com:3000/student/ansible-generic-project.git, using branch master.
It should use the student-scm SCM Credential you create in order to connect to the Git repo.
Create a Job Template in Red Hat Ansible Tower named vyos-hn-dn-ns.
The JOB TYPE should be Check, the INVENTORY should be the lab.example.com inventory that was created in Lab 4.
The MACHINE CREDENTIAL should be the vyos-access Credential created in step 1.
The PLAYBOOK should be the set-hn-dn-ns.yml playbook that was created and pushed to the ansible-generic-project Git repo in Lab 7.3.
Execute the Job Template to check your playbook.
Add back the line vault_password_file = ../.rhv/vault-secret to your ansible.cfg file.
You MUST have completed Lab 4 and created the lab.example.com inventory in order to complete this lab.
Temporarily remove the line vault_password_file = ../.rhv/vault-secret from your ansible.cfg file then commit your work to the Git repository.
[student@workstation ansible-generic-project]$cat ansible.cfg[defaults] inventory = inventory host_key_checking = False gathering = explicit [persistent_connection] command_timeout = 180 connect_timeout = 100 connect_retry_timeout = 100
Update the repository.
If prompted the Git credentials are student, password student.
[student@workstation ansible-generic-project]$git add ansible.cfg[student@workstation ansible-generic-project]$git commit -m "ch7 lab 4"[student@workstation ansible-generic-project]$git push
Create a credential named vyos-access that provides administrative access to VyOS devices as user vyos with password vyos.
The Credential type is Machine.
Click the Settings icon (the gear icon at the upper right) to go to the SETTINGS screen.
Click the Credentials card to go to the SETTINGS / CREDENTIALS screen.
At the SETTINGS / CREDENTIALS screen, click to add a credential.
At the CREATE CREDENTIAL screen, set the NAME field to vyos-access.
Set TYPE to Machine.
In the TYPE DETAILS form, set USERNAME to vyos and PASSWORD to vyos.
Click at the lower right to finalize the creation of the vyos-access Credential.
Create a credential named student-scm that provides read access to the ansible-generic-project Git repo as user student with password student.
The Credential type is Source Control.
Click the Settings icon (the gear icon at the upper right) to go to the SETTINGS screen.
Click the Credentials card to go to the SETTINGS / CREDENTIALS screen.
At the SETTINGS / CREDENTIALS screen, click to add a credential.
At the CREATE CREDENTIAL screen, set the NAME field to student-scm.
Set TYPE to Source Control.
In the TYPE DETAILS form, set USERNAME to student and PASSWORD to student.
Click at the lower right to finalize the creation of the student-scm Credential.
Create a Project in Red Hat Ansible Tower named vyos-hn-dn-ns.
The project should have SCM Type of Git, and be configured with SCM source URL of http://git.lab.example.com:3000/student/ansible-generic-project.git, using branch master.
It should use the student-scm SCM Credential you create in order to connect to the Git repo.
At the landing page, click the PROJECTS link to go to the PROJECTS page.
On the PROJECTS page, click to add a project.
Set the NAME field to vyos-hn-dn-ns.
Click the magnifying glass icon to select Default in the ORGANIZATION field.
Set SCM TYPE to Git.
In the SOURCE DETAILS form, set SCM URL to http://git.lab.example.com:3000/student/ansible-generic-project.git, SCM BRANCH to master, and SCM CREDENTIAL to student-scm.
Click to finalize the creation of the vyos-hn-dn-ns Project.
Create a Job Template in Red Hat Ansible Tower named vyos-hn-dn-ns.
The JOB TYPE should be Check, the INVENTORY should be the lab.example.com inventory that was created in Lab 4.
The MACHINE CREDENTIAL should be the vyos-access Credential created in step 1.
The PLAYBOOK should be the set-hn-dn-ns.yml playbook that was created and pushed to the ansible-generic-project Git repo in Lab 7.3.
At the landing page, click the link to go to the TEMPLATE page.
On the TEMPLATES page, click to add a template and select Job Template as the template type.
Set the NAME field to vyos-hn-dn-ns.
Set JOB TYPE to Check, INVENTORY to lab.example.com, and PROJECT to vyos-hn-dn-ns.
For PLAYBOOK, select the set-hn-dn-ns.yml playbook that was created and pushed to the ansible-generic-project Git repo in Lab 7.3.
Set MACHINE CREDENTIAL to vyos-access.
Set Limit to vyos.
Click to finalize the creation of the vyos-hn-dn-ns Job Template.
Execute the Job Template to check your playbook.
Add back the line vault_password_file = ../.rhv/vault-secret to your ansible.cfg file.
[student@workstation ansible-generic-project]$cat ansible.cfg[defaults] inventory = inventory host_key_checking = False gathering = explicit vault_password_file = ../.rhv/vault-secret [persistent_connection] command_timeout = 180 connect_timeout = 100 connect_retry_timeout = 100