Tuesday, January 10, 2017

Redhat Ansible Tower Installation



Check correct date time

[root@rhelnode1 jboss]# date
อ. 10 ม.ค. 2560 03:04:44 EST
[root@rhelnode1 jboss]# timedatectl
      Local time: อ. 2017-01-10 03:06:49 EST
  Universal time: อ. 2017-01-10 08:06:49 UTC
        RTC time: อ. 2017-01-10 08:06:48
       Time zone: America/New_York (EST, -0500)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  อา. 2016-11-06 01:59:59 EDT
                  อา. 2016-11-06 01:00:00 EST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  อา. 2017-03-12 01:59:59 EST
                  อา. 2017-03-12 03:00:00 EDT
[root@rhelnode1 jboss]# timedatectl
[root@rhelnode1 jboss]# timedatectl set-ntp yes
[root@rhelnode1 jboss]# timedatectl list-timezones | grep Bangkok
Asia/Bangkok
[root@rhelnode1 jboss]# 
[root@rhelnode1 jboss]# 
[root@rhelnode1 jboss]# 
[root@rhelnode1 jboss]# timedatectl set-timezone Asia/Bangkok
[root@rhelnode1 jboss]# date
อ. 10 ม.ค. 2560 15:14:10 ICT
[root@rhelnode1 jboss]# timedatectl
      Local time: อ. 2017-01-10 15:14:32 ICT
  Universal time: อ. 2017-01-10 08:14:32 UTC
        RTC time: อ. 2017-01-10 08:14:17
       Time zone: Asia/Bangkok (ICT, +0700)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a


Configure Repository Access (link) or download from url
Ref.
https://access.redhat.com/solutions/3358
http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F


[jboss@rhelnode1 ~]$ ls -lt
total 736
-rw-r--r--. 1 jboss jboss 737047 ม.ค.  10 02:24 ansible-tower-setup-latest.tar.gz
-rw-r--r--. 1 jboss jboss  14612 ม.ค.  10 02:23 epel-release-latest-7.noarch.rpm
[jboss@rhelnode1 ~]$ sudo yum install epel-release-latest-7.noarch.rpm
[sudo] password for jboss: 
Loaded plugins: search-disabled-repos
Examining epel-release-latest-7.noarch.rpm: epel-release-7-8.noarch
Marking epel-release-latest-7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                            Arch                         Version                    Repository                                           Size
======================================================================================================================================================
Installing:
 epel-release                       noarch                       7-8                        /epel-release-latest-7.noarch                        24 k

Transaction Summary
======================================================================================================================================================
Install  1 Package

Total size: 24 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-8.noarch                                                                                                            1/1 
  Verifying  : epel-release-7-8.noarch                                                                                                            1/1 

Installed:
  epel-release.noarch 0:7-8                                                                                                                           

Complete!


Subscribe to the new Extras channel/repo (link)


[root@rhelnode1 rhn]# subscription-manager register --auto-attach
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: nutthaphon@gmail.com
Password: 
The system has been registered with ID: 7a8d7e9a-022e-47c8-a5e2-12102c7c4609 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@rhelnode1 rhn]# subscription-manager repos --enable rhel-7-server-extras-rpms
Repository 'rhel-7-server-extras-rpms' is enabled for this system.


[root@rhelnode1 rhn]# yum install ansible
Loaded plugins: search-disabled-repos
rhel-7-server-extras-rpms                                                                                                      | 3.4 kB  00:00:00     
rhel-7-server-rpms                                                                                                             | 3.5 kB  00:00:00     
(1/6): rhel-7-server-extras-rpms/x86_64/group                                                                                  |  104 B  00:00:01     
(2/6): rhel-7-server-extras-rpms/x86_64/updateinfo                                                                             | 120 kB  00:00:01     
(3/6): rhel-7-server-extras-rpms/x86_64/primary_db                                                                             | 162 kB  00:00:00     
(4/6): rhel-7-server-rpms/7Server/x86_64/group                                                                                 | 701 kB  00:00:01     
(5/6): rhel-7-server-rpms/7Server/x86_64/updateinfo                                                                            | 1.8 MB  00:00:03     
(6/6): rhel-7-server-rpms/7Server/x86_64/primary_db                                                                            |  32 MB  00:00:24     
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.2.0.0-4.el7 will be installed
--> Processing Dependency: sshpass for package: ansible-2.2.0.0-4.el7.noarch
--> Processing Dependency: python-paramiko for package: ansible-2.2.0.0-4.el7.noarch
--> Processing Dependency: python-keyczar for package: ansible-2.2.0.0-4.el7.noarch
--> Processing Dependency: python-jinja2 for package: ansible-2.2.0.0-4.el7.noarch
--> Processing Dependency: python-httplib2 for package: ansible-2.2.0.0-4.el7.noarch
--> Running transaction check
---> Package python-httplib2.noarch 0:0.7.7-3.el7 will be installed
---> Package python-jinja2.noarch 0:2.7.2-2.el7 will be installed
--> Processing Dependency: python-babel >= 0.8 for package: python-jinja2-2.7.2-2.el7.noarch
--> Processing Dependency: python-markupsafe for package: python-jinja2-2.7.2-2.el7.noarch
---> Package python-keyczar.noarch 0:0.71c-2.el7 will be installed
--> Processing Dependency: python-pyasn1 for package: python-keyczar-0.71c-2.el7.noarch
--> Processing Dependency: python-crypto for package: python-keyczar-0.71c-2.el7.noarch
---> Package python2-paramiko.noarch 0:1.16.1-1.el7 will be installed
--> Processing Dependency: python2-ecdsa for package: python2-paramiko-1.16.1-1.el7.noarch
---> Package sshpass.x86_64 0:1.05-5.el7 will be installed
--> Running transaction check
---> Package python-babel.noarch 0:0.9.6-8.el7 will be installed
---> Package python-markupsafe.x86_64 0:0.11-10.el7 will be installed
---> Package python2-crypto.x86_64 0:2.6.1-10.el7 will be installed
--> Processing Dependency: libtomcrypt.so.0()(64bit) for package: python2-crypto-2.6.1-10.el7.x86_64
---> Package python2-ecdsa.noarch 0:0.13-4.el7 will be installed
---> Package python2-pyasn1.noarch 0:0.1.9-7.el7 will be installed
--> Running transaction check
---> Package libtomcrypt.x86_64 0:1.17-23.el7 will be installed
--> Processing Dependency: libtommath >= 0.42.0 for package: libtomcrypt-1.17-23.el7.x86_64
--> Processing Dependency: libtommath.so.0()(64bit) for package: libtomcrypt-1.17-23.el7.x86_64
--> Running transaction check
---> Package libtommath.x86_64 0:0.42.0-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                              Arch                      Version                            Repository                                    Size
======================================================================================================================================================
Installing:
 ansible                              noarch                    2.2.0.0-4.el7                      epel                                         4.6 M
Installing for dependencies:
 libtomcrypt                          x86_64                    1.17-23.el7                        epel                                         224 k
 libtommath                           x86_64                    0.42.0-4.el7                       epel                                          35 k
 python-babel                         noarch                    0.9.6-8.el7                        rhel-7-server-rpms                           1.4 M
 python-httplib2                      noarch                    0.7.7-3.el7                        epel                                          70 k
 python-jinja2                        noarch                    2.7.2-2.el7                        rhel-7-server-extras-rpms                    516 k
 python-keyczar                       noarch                    0.71c-2.el7                        epel                                         218 k
 python-markupsafe                    x86_64                    0.11-10.el7                        rhel-7-server-rpms                            25 k
 python2-crypto                       x86_64                    2.6.1-10.el7                       epel                                         475 k
 python2-ecdsa                        noarch                    0.13-4.el7                         epel                                          83 k
 python2-paramiko                     noarch                    1.16.1-1.el7                       epel                                         257 k
 python2-pyasn1                       noarch                    0.1.9-7.el7                        rhel-7-server-rpms                           100 k
 sshpass                              x86_64                    1.05-5.el7                         epel                                          21 k

Transaction Summary
======================================================================================================================================================
Install  1 Package (+12 Dependent packages)

Total download size: 7.9 M
Installed size: 35 M
Is this ok [y/d/N]: y
Downloading packages:
(1/13): libtommath-0.42.0-4.el7.x86_64.rpm                                                                                     |  35 kB  00:00:01     
(2/13): libtomcrypt-1.17-23.el7.x86_64.rpm                                                                                     | 224 kB  00:00:01     
(3/13): python-keyczar-0.71c-2.el7.noarch.rpm                                                                                  | 218 kB  00:00:00     
warning: /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages/python-babel-0.9.6-8.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Public key for python-babel-0.9.6-8.el7.noarch.rpm is not installed
(4/13): python-babel-0.9.6-8.el7.noarch.rpm                                                                                    | 1.4 MB  00:00:02     
(5/13): python-markupsafe-0.11-10.el7.x86_64.rpm                                                                               |  25 kB  00:00:00     
(6/13): python-httplib2-0.7.7-3.el7.noarch.rpm                                                                                 |  70 kB  00:00:02     
(7/13): python2-crypto-2.6.1-10.el7.x86_64.rpm                                                                                 | 475 kB  00:00:00     
Public key for python-jinja2-2.7.2-2.el7.noarch.rpm is not installed
(8/13): python-jinja2-2.7.2-2.el7.noarch.rpm                                                                                   | 516 kB  00:00:01     
(9/13): sshpass-1.05-5.el7.x86_64.rpm                                                                                          |  21 kB  00:00:00     
(10/13): python2-pyasn1-0.1.9-7.el7.noarch.rpm                                                                                 | 100 kB  00:00:00     
(11/13): python2-ecdsa-0.13-4.el7.noarch.rpm                                                                                   |  83 kB  00:00:01     
(12/13): python2-paramiko-1.16.1-1.el7.noarch.rpm                                                                              | 257 kB  00:00:01     
(13/13): ansible-2.2.0.0-4.el7.noarch.rpm                                                                                      | 4.6 MB  00:00:09     
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                 846 kB/s | 7.9 MB  00:00:09     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Importing GPG key 0xFD431D51:
 Userid     : "Red Hat, Inc. (release key 2) <security@redhat.com>"
 Fingerprint: 567e 347a d004 4ade 55ba 8a5f 199e 2f91 fd43 1d51
 Package    : redhat-release-server-7.3-7.el7.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Importing GPG key 0x2FA658E0:
 Userid     : "Red Hat, Inc. (auxiliary key) <security@redhat.com>"
 Fingerprint: 43a6 e49c 4a38 f4be 9abf 2a53 4568 9c88 2fa6 58e0
 Package    : redhat-release-server-7.3-7.el7.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : sshpass-1.05-5.el7.x86_64                                                                                                         1/13 
  Installing : python-babel-0.9.6-8.el7.noarch                                                                                                   2/13 
  Installing : python2-pyasn1-0.1.9-7.el7.noarch                                                                                                 3/13 
  Installing : libtommath-0.42.0-4.el7.x86_64                                                                                                    4/13 
  Installing : libtomcrypt-1.17-23.el7.x86_64                                                                                                    5/13 
  Installing : python2-crypto-2.6.1-10.el7.x86_64                                                                                                6/13 
  Installing : python-keyczar-0.71c-2.el7.noarch                                                                                                 7/13 
  Installing : python2-ecdsa-0.13-4.el7.noarch                                                                                                   8/13 
  Installing : python2-paramiko-1.16.1-1.el7.noarch                                                                                              9/13 
  Installing : python-httplib2-0.7.7-3.el7.noarch                                                                                               10/13 
  Installing : python-markupsafe-0.11-10.el7.x86_64                                                                                             11/13 
  Installing : python-jinja2-2.7.2-2.el7.noarch                                                                                                 12/13 
  Installing : ansible-2.2.0.0-4.el7.noarch                                                                                                     13/13 
  Verifying  : python-keyczar-0.71c-2.el7.noarch                                                                                                 1/13 
  Verifying  : python-markupsafe-0.11-10.el7.x86_64                                                                                              2/13 
  Verifying  : python-jinja2-2.7.2-2.el7.noarch                                                                                                  3/13 
  Verifying  : python-httplib2-0.7.7-3.el7.noarch                                                                                                4/13 
  Verifying  : python2-ecdsa-0.13-4.el7.noarch                                                                                                   5/13 
  Verifying  : libtomcrypt-1.17-23.el7.x86_64                                                                                                    6/13 
  Verifying  : ansible-2.2.0.0-4.el7.noarch                                                                                                      7/13 
  Verifying  : libtommath-0.42.0-4.el7.x86_64                                                                                                    8/13 
  Verifying  : python2-pyasn1-0.1.9-7.el7.noarch                                                                                                 9/13 
  Verifying  : python-babel-0.9.6-8.el7.noarch                                                                                                  10/13 
  Verifying  : python2-crypto-2.6.1-10.el7.x86_64                                                                                               11/13 
  Verifying  : python2-paramiko-1.16.1-1.el7.noarch                                                                                             12/13 
  Verifying  : sshpass-1.05-5.el7.x86_64                                                                                                        13/13 

Installed:
  ansible.noarch 0:2.2.0.0-4.el7                                                                                                                      

Dependency Installed:
  libtomcrypt.x86_64 0:1.17-23.el7                   libtommath.x86_64 0:0.42.0-4.el7                 python-babel.noarch 0:0.9.6-8.el7              
  python-httplib2.noarch 0:0.7.7-3.el7               python-jinja2.noarch 0:2.7.2-2.el7               python-keyczar.noarch 0:0.71c-2.el7            
  python-markupsafe.x86_64 0:0.11-10.el7             python2-crypto.x86_64 0:2.6.1-10.el7             python2-ecdsa.noarch 0:0.13-4.el7              
  python2-paramiko.noarch 0:1.16.1-1.el7             python2-pyasn1.noarch 0:0.1.9-7.el7              sshpass.x86_64 0:1.05-5.el7                    

Complete!


/var sizing by requirements must more than 10Gb
                If you download RHEL qcow2 image from Redhat Portal, a /var filesystem is in / root filesystem that space less than Ansible Tower recommentation. So you should create new disk and mount as /var instead of existing /var in / root filesystem.


$ sudo mkdir /tmp/var
$ sudo mount /dev/vdb /tmp/var/
$ sudo rsync -avz /var/ /tmp/var/
$ sudo blkid

Add new line
$ sudo vi /etc/fstab
UUID=ac1cda02-5a44-4b04-b6ad-a28bf69639e6 /var                    xfs     defaults        0 2
Reboot 
$ sudo restorecon -R /var


Starting, Stopping, and Restarting Tower

/usr/bin/ansible-tower-service [ start | stop | restart | status ]


[jboss@rhelnode1 ~]$ ansible-tower-service status
Showing Tower Status
Redirecting to /bin/systemctl status  postgresql-9.4.service
 postgresql-9.4.service - PostgreSQL 9.4 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.4.service; enabled; vendor preset: disabled)
   Active: active (running) since อ. 2017-01-10 21:30:22 ICT; 20min ago
  Process: 890 ExecStart=/usr/pgsql-9.4/bin/pg_ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=0/SUCCESS)
  Process: 845 ExecStartPre=/usr/pgsql-9.4/bin/postgresql94-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 1990 (postgres)
   CGroup: /system.slice/postgresql-9.4.service
           ├─1990 /usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
           ├─2167 postgres: logger process   
           ├─2202 postgres: checkpointer process   
           ├─2203 postgres: writer process   
           ├─2204 postgres: wal writer process   
           ├─2205 postgres: autovacuum launcher process   
           ├─2206 postgres: stats collector process   
           ├─2249 postgres: awx awx 127.0.0.1(60506) idle
           ├─2250 postgres: awx awx 127.0.0.1(60508) idle
           ├─2251 postgres: awx awx 127.0.0.1(60510) idle
           └─2253 postgres: awx awx 127.0.0.1(60530) idle
Redirecting to /bin/systemctl status  redis.service
 redis.service - Redis persistent key-value database
   Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/redis.service.d
           └─limit.conf
   Active: active (running) since อ. 2017-01-10 21:30:06 ICT; 20min ago
 Main PID: 841 (redis-server)
   CGroup: /system.slice/redis.service
           └─841 /usr/bin/redis-server 127.0.0.1:6379
Redirecting to /bin/systemctl status  httpd.service
 httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since อ. 2017-01-10 21:30:18 ICT; 20min ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 853 (httpd)
   Status: "Total requests: 59; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─ 853 /usr/sbin/httpd -DFOREGROUND
           ├─2070 (wsgi:awx)      -DFOREGROUND
           ├─2071 (wsgi:awx)      -DFOREGROUND
           ├─2072 (wsgi:awx_plain -DFOREGROUND
           ├─2073 (wsgi:awx_plain -DFOREGROUND
           ├─2074 /usr/sbin/httpd -DFOREGROUND
           ├─2075 /usr/sbin/httpd -DFOREGROUND
           ├─2076 /usr/sbin/httpd -DFOREGROUND
           ├─2077 /usr/sbin/httpd -DFOREGROUND
           ├─2078 /usr/sbin/httpd -DFOREGROUND
           ├─2302 /usr/sbin/httpd -DFOREGROUND
           ├─2307 /usr/sbin/httpd -DFOREGROUND
           ├─2308 /usr/sbin/httpd -DFOREGROUND
           ├─2310 /usr/sbin/httpd -DFOREGROUND
           └─2329 /usr/sbin/httpd -DFOREGROUND
Redirecting to /bin/systemctl status  supervisord.service
 supervisord.service - Process Monitoring and Control Daemon
   Loaded: loaded (/usr/lib/systemd/system/supervisord.service; enabled; vendor preset: disabled)
   Active: active (running) since อ. 2017-01-10 21:30:03 ICT; 20min ago
  Process: 510 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS)
 Main PID: 642 (supervisord)
   CGroup: /system.slice/supervisord.service
           ├─ 642 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf
           ├─ 659 python /usr/bin/tower-manage run_socketio_service
           ├─ 660 python /usr/bin/tower-manage run_fact_cache_receiver
           ├─ 661 python /usr/bin/tower-manage run_task_system
           ├─ 662 python /usr/bin/tower-manage celery worker -B -l debug --autoscale=50,4 -Ofair -s /var/lib/awx/beat.db
           ├─ 663 python /usr/bin/tower-manage run_callback_receiver
           ├─2256 python /usr/bin/tower-manage run_callback_receiver
           ├─2257 python /usr/bin/tower-manage run_callback_receiver
           ├─2258 python /usr/bin/tower-manage run_callback_receiver
           ├─2259 python /usr/bin/tower-manage run_callback_receiver
           ├─2260 python /usr/bin/tower-manage run_callback_receiver
           ├─2279 python /usr/bin/tower-manage celery worker -B -l debug --autoscale=50,4 -Ofair -s /var/lib/awx/beat.db
           ├─2280 python /usr/bin/tower-manage celery worker -B -l debug --autoscale=50,4 -Ofair -s /var/lib/awx/beat.db
           ├─2281 python /usr/bin/tower-manage celery worker -B -l debug --autoscale=50,4 -Ofair -s /var/lib/awx/beat.db
           ├─2282 python /usr/bin/tower-manage celery worker -B -l debug --autoscale=50,4 -Ofair -s /var/lib/awx/beat.db
           └─2283 python /usr/bin/tower-manage celery worker -B -l debug --autoscale=50,4 -Ofair -s /var/lib/awx/beat.db


Change admin user password


[jboss@rhelnode1 ~]$ sudo tower-manage changepassword admin
[sudo] password for jboss: 
Changing password for user 'admin'
Password: 
Password (again): 
Password changed successfully for user 'admin'














No comments:

Post a Comment