Ansible tower

How to Install Ansible AWX on CentOS 7

Ansible Tower is a web-based solution that makes Ansible even easier to use for IT teams of all kinds. It’s designed to be the hub for all of your automation tasks.

Tower allows you to control access to who can access what, even allowing sharing of SSH credentials without someone being able to transfer those credentials. Inventory can be graphically managed or synced with a wide variety of cloud sources. 

It logs all of your jobs, integrates well with LDAP, and has an amazing browsable REST API. Command-line tools are available for easy integration with Jenkins as well. Provisioning callbacks provide great support for autoscaling topologies.


Prerequisites

Requires Version 2.8+

At least 4GB of memory

At least 2 CPU cores

At least 20GB of space


Ansible tower installation

follow the below link for AWX installation

https://awx.wiki/blog/new-build-server-new-installer-new-maintainers-same-project


Ansible Tower Quick Setup Guide

Log in as a Superuser

Using the login information provided after your installation completed, open a web browser and log in to Tower by browsing to the Tower server URL at HTTPS:///

Examine the Tower Dashboard

The Tower Dashboard offers a friendly graphical framework for your IT orchestration needs. Along the left side of the Tower Dashboard is the navigation menu, where you can quickly navigate to your Projects, Inventories, Job Templates, and Jobs.


Create a new Inventory 

An inventory is a collection of hosts managed by Tower. Inventories are assigned to organizations, while permissions to launch playbooks against inventories are controlled at the user and/or team level.


To review existing inventories:

Click the Inventories (inventories-icon) icon from the left navigation bar.



Click the add ADD button and select Inventory from the drop-down menu list.

To give 

User name like windows inventory

Organization: Default

In Variables: YAML (only on windows servers)

---

ansible_user: zippyops

ansible_password: zippyops

#ansible_port: 5986

ansible_connection: winrm

ansible_winrm_scheme: https

ansible_winrm_server_cert_validation: ignore


In the Hosts tab, click the button to the inventory.

 In  Hosts

Hostname:  your node hostname

Variables: host IP address 

Click the Save button.

Create a Credential

Credentials authenticate the Tower user to launch Ansible playbooks, which can include passwords and SSH keys, against inventory hosts. You can also require the Tower user to enter a password or key phrase when a playbook launches using the credentials feature of Tower.

Create a new credential by clicking the Credentials icon from the left navigation bar.

In the Credential tab, click the add  button

Click the Save button.

Setting up a Project

Project is a logical collection of Ansible playbooks, represented in Tower.


You can manage playbooks and playbook directories by either placing them manually under the Project Base Path on your Tower server, or by placing your playbooks into a source code management (SCM) system supported by Tower, including Git, Subversion, and Mercurial.


To create a new one, click the Projects (projects-icon) icon from the left navigation bar.


 To Create a playbook Directory in /var/lib/awx/projects  ….location using Terminal window

[root@ansible projects]# cd /var/lib/awx/projects/

[root@ansible projects]#mkdir war_deploy

Inside the directory to create a playbook like war1.yml

[root@ansible war_deploy]# vi war1.yml

---

- hosts: all

  tasks:

    - name: copy war

      win_copy:

         src: /var/lib/jenkins/workspace/pipeline project/java-sample-app/target/java-sample-app-1.0.0.war

         dest: C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\

     - name: Restart a service

       win_service:

         name: Tomcat7

         state: restarted


Before this project can be used in a job template, you must manually start an SCM sync for this project.


Update the SCM-based demo project by clicking the sync button under the project’s available Actions:


Create a new Job Template

A job template combines an Ansible playbook from a project and the settings required to launch it. Review existing jobs or create a new job template by clicking the Templates        (templates-icon) icon from the left navigation bar.


Click ADD


Click Save

Launch it!

From the Job Templates overview screen, click the Launch (launch) button (under Actions) to run this Job Template.

The initial job launch returns a status page that updates automatically using Tower’s Live Event feature until the job is complete.

Recent Comments

No comments

Leave a Comment