0% found this document useful (0 votes)
20 views12 pages

Red Hat Ansible Tower-Demo v1

Red_Hat_Ansible_Tower-Demo_v1

Uploaded by

alan.liuxiang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views12 pages

Red Hat Ansible Tower-Demo v1

Red_Hat_Ansible_Tower-Demo_v1

Uploaded by

alan.liuxiang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Red Hat Ansible Tower

Demo

Demo’s Guide
(The Language of DevOps Automation)

Prepared by: Robert Calva – LATAM Sr. Solutions Architect - Mgmt & Automation
Modified by: Robert Calva – LATAM Sr. Solutions Architect - Mgmt & Automation

Creation date: 01/25/17


Date of last modification: 03/04/19
Version: 1.1
SUMMARY

Business Scenario

Ansible is the first automation language that can be read and written across IT. Ansible is the only automation engine
that can automate the entire and continuous delivery pipeline.

DEMO: RED HAT ANSIBLE TOWER

Access to Ansible Tower Web Portal,

User: demo / Password: Redhat1!

You can take a tour of the entire user interface to show the different sections, such as Dashboard, Views, Resources,
Accesses, Settings and so on.

Demo 1: Create new Apache Webserver via Job Template

First, click on your Web Server URL to be sure a Web Server is not installed (where GUID is your RHPDS App ID):

http://webserver-GUID.rhpds.opentlc.com

Then, access to Ansible Tower. Click on Templates and find the “Install Web Server” Job Template. Click on
to start a job creation using this template.

This Action will launch the Install Web Server Job Template, starting the Webserver installation. You will be redirected to
a dynamic Job Output page:
You will see the Status of the Job, Started / Finished Time, Tasks, etc.

If your Job finished Ok, with Status Successful, go back to your Web Server URL and make sure your Web Server is Up
& Running.

We will be taking a look at the Ansible Playbook we are using for this Job Template, following this link:

https://github.com/rcalvaga/ansible-examples/blob/master/lamp_simple_rhel7/site.yml

Demo 2: Create new Wordpress Website via Job Template

First, click on your Wordpress Server URL to be sure it's not installed:

http://wordpress-GUID.rhpds.opentlc.com

Then, access to Ansible Tower. Click on Templates and find the “Install Wordpress Server” Job Template.

Click on to start a job creation using this template.

This Action will launch the Install Wordpress Server Job Template, starting the Website installation. You will be
redirected to a dynamic Job Output page:
You will see the Status of the Job, Started / Finished Time, Tasks, etc.

If your Job finished Ok, with Status Successful, go back to your Wordpress Server URL and make sure your Wordpress
Server is Up & Running. Play a moment with your new Wordpress!

We will be taking a look at the Ansible Playbook we are using for this Job Template, following this link:

https://github.com/rcalvaga/ansible-examples/blob/master/wordpress-nginx_rhel7/site.yml

Demo 3: Create new JBoss Application Server via Workflow Template

First, click on your JBoss Application Server URL to be sure it's not installed:

http://jboss-GUID.rhpds.opentlc.com:8080

Make sure your JBoss Java Application URL is not available:


http://jboss-GUID.rhpds.opentlc.com:8080/ticket-monster

Click on Templates → Deploy a Java App within JBoss → WORKFLOW VISUALIZER. Our Workflow
Template looks like this:

Now Click on Templates and find the “Deploy a Java App within JBoss” Workflow Template. Click on to start
a Workflow Job creation using this workflow template.

This Action will launch the “Install App Server” Job Template, starting the JBoss App Server installation and then will
launch “Install Java App”, deploying two new Java applications within our new Application Server. You will be redirected
to a dynamic Job Output page:

You will see the Status of the Job, Started / Finished Time, Tasks, etc.

If your First Job finished Ok, with Status Successful, go back to your JBoss Application Server URL and make sure
your App Server is Up & Running, accessing via :8080 Port!

If our Second Job has a Succesful status, Workflow finishes.

Click on Administration Console link. You can access to the JBoss Administration Console:

User: admin / Password: Redhat1!


Then click on Deployments → Manage Deployments. Refresh page if necessary. You will see your new
deployments:

We will be taking a look at the Ansible Playbook we are using for this Job Template, following this link:

https://github.com/rcalvaga/examples-ansible/blob/master/jboss-standalone/site.yml

Then you can access to your JBoss Java Application URL (with :8080/ticket-monster context root and then try with
:8080/helloworld)

You can access to TicketMonster Web Application Server to buy some tickets. Just play a moment with your new
Java Application!
Demo 4: Running Ad-Hoc Commands Using Ansible Tower

Scenario

An Ad-Hoc command is something that you might type in to do something really quick, but don’t want to save for later.
We will use Ansible Tower to run some Ad-Hoc commands, such as date, last, whoami ans so on, into some different
servers at the same time.

Tasks

Using our servers in Physical Inventory, run some commands using different Ansible Modules.

Click on Inventories and then click on Physical Inventory → GROUPS. Then select (check) our 3 different Groups:
appservers-group, lamp-servers and wordpress-servers:

After that, click on RUN COMMANDS button:

4A. Using Command Module:

Within EXECUTE COMMAND section, run date command as follows:

MODULE: command
MACHINE CREDENTIAL: SSH Server Credentials
ARGUMENTS: date
LIMIT: appservers-group:lamp-servers:wordpress-servers ←(keep it as is)

Click on LAUNCH to run the command. Observe the results.

You will observe within STANDARD OUT section something like this:
NOTE: You can click on Download Output to download the results.

Click on Inventories and then click on Physical Inventory → GROUPS. Select the same Groups and click on RUN
COMMANDS again.

Within EXECUTE COMMAND section, run last command as follows:

MODULE: command
MACHINE CREDENTIAL: SSH Server Credentials
ARGUMENTS: last
LIMIT: appservers-group:lamp-servers:wordpress-servers ←(keep it as is)

Click on LAUNCH to run the command. Observe the results.

You will observe within STANDARD OUT section something like this:

4B. Using Yum Module:

Click on Inventories and then click on Physical Inventory → GROUPS. Select the same Groups and click on RUN
COMMANDS again.

Within EXECUTE COMMAND section, using yum module, install telnet package as follows:

MODULE: yum
MACHINE CREDENTIAL: SSH Server Credentials
ARGUMENTS: name=telnet state=latest
LIMIT: appservers-group:lamp-servers:wordpress-servers ←(keep it as is)

Click on LAUNCH to run the command. Observe the results.

You will observe within STANDARD OUT section something like that:
4C. Using User Module:

Click on Inventories and then click on Physical Inventory → GROUPS. Select the same Groups and click on RUN
COMMANDS again.

Within EXECUTE COMMAND section, using User module, create demo user as follows:

MODULE: user
MACHINE CREDENTIAL: SSH Server Credentials
ARGUMENTS: name=demo comment="Demo User" password=$1$ctRQ8kmb$PMF.2YAjQrdjiDGFuE4uw0 ←(needs to be
crypted)
LIMIT: appservers-group:lamp-servers:wordpress-servers ←(keep it as is)

Click on LAUNCH to run the command. Observe the results.

You will observe within STANDARD OUT section something like that:

4D. Using Ping Module:

Click on Inventories and then click on Physical Inventory → GROUPS. Select the same Groups and click on RUN
COMMANDS again.

Within EXECUTE COMMAND section, using Ping module, ping hosts in Groups as follows:

MODULE: ping
MACHINE CREDENTIAL: SSH Server Credentials
ARGUMENTS:
LIMIT: appservers-group:lamp-servers:wordpress-servers ←(keep it as is)

Click on LAUNCH to run the command. Observe the results.

You will observe within STANDARD OUT section something like that:
Demo 5: Automating Windows

Ansible knew that the key was to bring the same simple, agentless paradigm to managing Windows, while still feeling
native to Windows administrators. Ansible’s native Windows support uses Windows PowerShell remoting to manage
Windows like Windows in the same Ansible agentless way that Ansible manages Linux like Linux.

Plus, with Ansible’s easy extensibility, you can write your own modules in PowerShell and extend Ansible for whatever
other functionality you need. Ansible users have written modules for managing filesystem ACLs, managing Windows
Firewall, and managing hostname and domain membership, and more.

In this demo we will be automating many tasks (such as creating users, copying files, configuring services, etc.) within a
Windows 2012 Server.

5A. First, verify that our Windows 2012 has not been yet automated:

Access to Windows 2012 via RDP:

windows.jboss-GUID.rhpds.opentlc.com

Username: Administrator / Domain: local / Password: Redhat1!

TASK: Verify that Telnet Client and IIS Web-Server has not been yet installed:

- Click on Server Manager → Add roles and features.


- Then click on Server Selection and then click on Server Roles. Verify that Web Server IIS has not been yet installed.
- Then click on Features and verify that Telnet Client has not been yet installed

TASK: Verify that Ansible User has not been yet created:

- Click on Control Panel → User Accounts → User Accounts → Manage Another Account. Verify that
Ansible User has not been yet created

TASK: Verify that nerd.jpg image does not exist:

- Click on File Explorer and then click on Downloads. Verify that nerd.jpg image does not exist.

5B. Run the Windows Job Template:

Click on Templates and find the “Automating Windows” Job Template. Click on to start a job creation using
this template.
This Action will automate some tasks on Windows 2012, such as:

- Add a Windows Admin User (Ansible User)


- Install Software (Telnet and IIS Server)
- Copy a JPG archive (neerdd.jpg as nerd.jpg)
- Run a PowerShell script (Hello World)
- Run some Windows commands (ipconfig)
- Check Status of file win.in
If your Job Template ran successfully, verify again steps in 6F section, but now you will find that Windows 2012 has
been automated!

Access to Windows 2012 URL but now via Web Browser, just to make sure Web Server IIS is Up and Running!

http://windows-GUID.rhpds.opentlc.com

Now just take a look at the Ansible Playbook:


https://github.com/rcalvaga/windows-ansible/blob/master/tower-ansible-automating-windows.yml

Demo 6: Automating Network Devices

7A. Access VyOS Appliance vía SSH/PuTTY :

$ ssh vyos-GUID.rhpds.opentlc.com

Username: vyos / Password: Redhat1!

7B. Verify that our VyOS Appliance is not yet configured, launching those commands (just take a look at the
output):

$ show configuration
$ show configuration commands
$ show nat source rules
Our VyOS is configured as general purpose router.

7C. Run the “Automating VyOS” Job Template:

Click on Templates and find the “Automating VyOS” Job Template. Click on to start a job creation using this
template.

This Action will automate some tasks on VyOS Network Virtual Appliance, providing a NAT Gateway for this device
with two interfaces, as described within the VyOS Quick Start Guide:

https://wiki.vyos.net/wiki/User_Guide#Quick_Start_Guide

7D. Verify that our VyOS Appliance is now configured as NAT Gateway, launching those commands (just take a
look at the output):

$ show configuration
$ show configuration commands
$ show nat source rules

Our VyOS is now configured as NAT Gateway.

If your Job Template ran successfully, just click on some tasks to verify that your VyOS has been automated!

Now take a look at the Ansible Playbook: https://github.com/rcalvaga/vyos-ansible/blob/master/tower-ansible-automating-


vyos.yml

You might also like