Ansible-Tower operation and maintenance management automation environment deployment records

 

The company implemented the operation and maintenance of automation architecture mainly used ansible, ansible script deployment server command line seems less intuitive. Ansible-Tower (previously referred AWX) is a command interface of ansible, simple intuitive, easy to use. The following are structures of the recording Ansible-Tower, under this sharing.

Ansible-Tower currently supported versions 7.4+, you can use the command yum update -y update;
 
1. Install the epel source Ansible
[root@ansible ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
 
[root@ansible ~]# python -V
Python 2.7.5

Close selinux
[root@ansible ansible-tower]# setenforce 0
setenforce: SELinux is disabled
[root@ansible ansible-tower]# getenforce 
Disabled
[root@ansible ansible-tower]# vim /etc/sysconfig/selinux 
.........
SELINUX=disabled

Turn off the firewall
[root@ansible ansible-tower]# systemctl stop firewalld    
[root@ansible ansible-tower]# systemctl disable firewalld 
[root@ansible ansible-tower]# firewall-cmd --state
not running

Download epel warehouse
[root@ansible ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@ansible ~]# rpm -ivh epel-release-latest-7.noarch.rpm --force
[root@ansible ~]# yum update -y
 
2. Clear the cache, installation Ansible
[root@ansible ~]# yum clean all
[root@ansible ~]# yum install -y ansible
[root@ansible ~]# ansible --version
ansible 2.8.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jun 20 2019, 20:27:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
 
3. Installation Ansible-Tower
Download: https: //releases.ansible.com/ansible-tower/setup/
Combat document: https: //kionf.com/2018/11/21/tower-useage/
 
[root@ansible ~]# cd /home/
[root@ansible home]# wget http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz
[root@ansible home]# tar -zvxf ansible-tower-setup-latest.tar.gz
[root@ansible home]# mv ansible-tower-setup-3.5.1-1/ /usr/local/ansible-tower
[root@ansible home]# cd /usr/local/ansible-tower
[root@ansible ansible-tower]# ls
backup.yml group_vars install.yml inventory Licenses README.md restore.yml Roles setup.sh
 
Inventory configuration file (here, set password is "324215", this code can be set.)
[root@ansible ansible-tower]# sed -i "s#password=''#password='324215'#g" inventory
[root@ansible ansible-tower]# sed -i "s#host=''#host='127.0.0.1'#g" inventory
[root@ansible ansible-tower]# sed -i "s#port=''#port='5432'#g" inventory
 
Installation Ansible-Tower
Create / var / log / tower logs directory before installation, or will be error
[root@ansible ansible-tower]# mkdir -p /var/log/tower
 
Followed by the installation, the installation process needs to be performed for a while
[root@ansible ansible-tower]# cd /usr/local/ansible-tower
[root@ansible ansible-tower]# ./setup.sh
.............
.............
PLAY [Install Tower isolated node(s)] ************************************************************************************************************
skipping: no hosts matched

PLAY RECAP ***************************************************************************************************************************************
localhost                  : ok=143  changed=69   unreachable=0    failed=0    skipped=59   rescued=0    ignored=3   

The setup process completed successfully.
Setup log saved to /var/log/tower/setup-2019-08-06-01:56:36.log

When information such as the installation appear above, it has been installed successfully on behalf of

ansible-tower port is defined in the inventory file, the port 5432 is as defined above
[root@ansible ansible-tower]# lsof -i:5432
COMMAND     PID     USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
python3     440      awx   33u  IPv4 70352043      0t0  TCP localhost:38588->localhost:postgres (ESTABLISHED)
python3     507      awx   19u  IPv4 70351368      0t0  TCP localhost:38634->localhost:postgres (ESTABLISHED)
python3     508      awx   24u  IPv4 70350748      0t0  TCP localhost:38638->localhost:postgres (ESTABLISHED)
python3     509      awx   29u  IPv4 70352538      0t0  TCP localhost:38648->localhost:postgres (ESTABLISHED)
python3     510      awx   34u  IPv4 70353121      0t0  TCP localhost:38652->localhost:postgres (ESTABLISHED)
postmaste   511 postgres   11u  IPv4 70352044      0t0  TCP localhost:postgres->localhost:38588 (ESTABLISHED)
postmaste   820 postgres   11u  IPv4 70350670      0t0  TCP localhost:postgres->localhost:38634 (ESTABLISHED)
postmaste   837 postgres   11u  IPv4 70353063      0t0  TCP localhost:postgres->localhost:38638 (ESTABLISHED)
postmaste   923 postgres   11u  IPv4 70351584      0t0  TCP localhost:postgres->localhost:38648 (ESTABLISHED)
postmaste   925 postgres   11u  IPv4 70350832      0t0  TCP localhost:postgres->localhost:38652 (ESTABLISHED)
postmaste 27553 postgres    3u  IPv4 70334943      0t0  TCP *:postgres (LISTEN)
postmaste 27553 postgres    4u  IPv6 70334944      0t0  TCP *:postgres (LISTEN)

Then you can access the server address, the address where access to https://172.16.60.246 [Username: admin Password: 324215]

========================================================================================================
If the firewall is turned on, the corresponding need to open access policy
[root@ansible ansible-tower]# firewall-cmd --permanent --zone=public --add-port=80/tcp
[root@ansible ansible-tower]# systemctl restart firewalld.service
========================================================================================================

默认Ansible-Tower是企业版的,需要输入License。不过可以进行破解,下面介绍下Ansible-Tower破解方法

 

Guess you like

Origin www.cnblogs.com/kevingrace/p/11306540.html
Recommended