ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Install AWX on CentOS 7 with Docker

    IT Discussion
    awx ansible docker centos7
    7
    25
    8.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • travisdh1T
      travisdh1
      last edited by travisdh1

      Did this write up because everything else I found online were outdated.

      I’m going to assume your starting from a CentOS 7 minimal install. It should have at least 2 cpu cores and 4GB RAM, tho I’d recommend more of each. Storage space wise, requirements call for at least 20GB, I went with 40GB.

      This guide was written using the AWX install instructions on github: https://github.com/ansible/awx/blob/devel/INSTALL.md

      In my case I did add in the XCP-ng guest tools as this is running on an XCP-ng server, but that shouldn’t affect anything in this guide.

      All of these commands need to be run as root. Add sudo at the start of each command, or start out with sudo su -

      Install some utilities I always like to have available.

      yum -y install nano epel-release git yum-cron
      yum -y install glances
      sed -i 's/no/yes/g' /etc/yum/yum-cron.conf
      systemctl enable --now yum-cron
      

      Make sure the network adapter starts on boot. I use static IP mapping through DHCP, so no IP config needs done here.

      sed -i 's/ONBOOT=no/ONBOOT=yes/g' /etc/sysconfig/network-scripts/ifcfg-eth0
      

      Add IP addresses for AWX server and guests to hosts file.

      echo "x.x.x.x awxhowto.travisdh1.net awxhowto" >> /etc/hosts
      echo "x.x.x.x xo.travisdh1.net xo" >> /etc/hosts
      echo "x.x.x.x nextcloud.travisdh1.net nextcloud" >> /etc/hosts
      

      Open http firewall port. Mine is behind a reverse proxy, so I don’t configure HTTPS here.

      firewall-cmd --permanent --add-service=http
      firewall-cmd --reload
      

      Start installing prerequisites. pip is needed for the docker python module, docker-compose, node and npm will not be the correct version from the repository, so we need to handle those ourselves.

      yum -y install ansible docker make automake python2-pip
      systemctl enable --now docker
      pip install --upgrade pip
      pip install docker-compose
      pip install docker
      curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
      source ~/.bashrc
      nvm install 8
      nvm use 8
      

      We should now have all the prerequisites installed, and the correct version of each. Now onto the actual AWX things.

      cd /opt
      git clone https://github.com/ansible/awx
      cd awx
      

      I don’t think the AWX branding is required, but I’ve always put it in.

      git clone https://github.com/ansible/awx-logos
      

      Create a directory to persist the PostgreSQL docker instance and update the config.

      mkdir /opt/postgresql
      sed -i 's:postgres_data_dir=/tmp/pgdocker:postgres_data_dir=/opt/postgresql:g' /root/awx/installer/inventory
      

      Tell the installer to build with the official logos.

      sed -i 's:awx_official=false:awx_official=true:g' /root/awx/installer/inventory
      

      Time to start the actual install

      cd installer
      ansible-playbook -i inventory install.yml
      

      That should be it. The web page will not be immediately available until some background processes finish. In order to check this progress use

      docker logs -f awx_task
      

      Look for:

      Python 2.7.5 (default, Nov  6 2016, 00:28:07)
      [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      (InteractiveConsole)
      
      >>> <User: admin>
      >>> Default organization added.
      Demo Credential, Inventory, and Job Template added.
      Successfully registered instance awx
      (changed: True)
      Creating instance group tower
      Added instance awx to tower
      (changed: True)
      

      You will need to get the default admin password changed asap. Which is admin/password.

      When done, you should be able to login and see:
      3f1efce0-5289-414d-9d50-886a0e75ace6-image.png

      Emad RE 1 Reply Last reply Reply Quote 2
      • travisdh1T
        travisdh1
        last edited by

        Reserved for nginx reverse proxy config.

        1 Reply Last reply Reply Quote 1
        • travisdh1T
          travisdh1
          last edited by travisdh1

          Reserved for update process

          1 Reply Last reply Reply Quote 1
          • Emad RE
            Emad R @travisdh1
            last edited by

            @travisdh1

            +++

            Many thanks for this I never heard of this project, glad finally we have UI for either SS or Ansible

            1 1 Reply Last reply Reply Quote 1
            • 1
              1337 @Emad R
              last edited by 1337

              @Emad-R said in Install AWX on CentOS 7 with Docker:

              @travisdh1

              +++

              Many thanks for this I never heard of this project, glad finally we have UI for either SS or Ansible

              The AWX project is upstream project for Red Hat's Ansible Tower.

              https://www.ansible.com/products/awx-project/faq

              travisdh1T 1 Reply Last reply Reply Quote 0
              • travisdh1T
                travisdh1 @1337
                last edited by

                @Pete-S said in Install AWX on CentOS 7 with Docker:

                @Emad-R said in Install AWX on CentOS 7 with Docker:

                @travisdh1

                +++

                Many thanks for this I never heard of this project, glad finally we have UI for either SS or Ansible

                The AWX project is upstream project for Red Hat's Ansible Tower.

                https://www.ansible.com/products/awx-project/faq

                Also has lots of Ansible playbooks available at https://galaxy.ansible.com/ to do all the things.

                1 Reply Last reply Reply Quote 1
                • F
                  faudel
                  last edited by scottalanmiller

                  Hi Travisdh,

                  Great article, i installed awx without a docker following this guide. [Moderated to remove promotional link.]

                  RojoLocoR 1 Reply Last reply Reply Quote -4
                  • RojoLocoR
                    RojoLoco @faudel
                    last edited by scottalanmiller

                    @faudel said in Install AWX on CentOS 7 with Docker:

                    Hi Travisdh,

                    Great article, i installed awx without a docker following this guide. Take a look at this link [Moderated to remove promotional link.]

                    ^^^ Kinda suspect, because:

                    This blog accepts forms of cash advertising, sponsorship, paid insertions or other forms of compensation. Aside from that we also make money from affiliate links.

                    1 Reply Last reply Reply Quote 0
                    • stacksofplatesS
                      stacksofplates
                      last edited by

                      Be careful with AWX. I would not use it in production. There are still breaking database changes between versions. There is a migration tool but still. Last time I used it, there were breaking changes from week to week. I've found Jenkins to be more flexible anyway.

                      1 Reply Last reply Reply Quote 2
                      • wirestyle22W
                        wirestyle22
                        last edited by wirestyle22

                        basic nginx config works and you can just run certbot for SSL

                        server {
                        	listen 80;
                        	server_name test.domain.com;
                        	location / {
                        	proxy_pass http://192.168.1.x;
                        	proxy_buffering off;
                        	}
                        }
                        
                        1 Reply Last reply Reply Quote 0
                        • wirestyle22W
                          wirestyle22
                          last edited by wirestyle22

                          I attempted to login with admin/password and it is telling me it's the wrong username/password. The documentation says:

                          awx-manage changepassword admin

                          -bash: awx-manage : command not found
                          

                          I am in /opt/awx

                          hm.

                          travisdh1T 1 Reply Last reply Reply Quote 0
                          • travisdh1T
                            travisdh1 @wirestyle22
                            last edited by

                            @wirestyle22 awx-manage might be in /opt/awx/bin, /opt/awx/sbin, or something like that. Here I thought the default username/password wouldn't get broken in their code updates. Like @stacksofplates said, AWX looks nice, but the devs are breaking it so often that it isn't something I'd consider production ready. I tried running through this a 3rd time, did everything the same, and it didn't work last night 😞

                            wirestyle22W 2 Replies Last reply Reply Quote 0
                            • wirestyle22W
                              wirestyle22 @travisdh1
                              last edited by

                              @travisdh1

                              awx.png

                              Yeah I am just testing at home

                              travisdh1T 1 Reply Last reply Reply Quote 1
                              • wirestyle22W
                                wirestyle22 @travisdh1
                                last edited by

                                @travisdh1 seems like I should be able to change the admin password via cli, but it's not recognizing the command. @stacksofplates any ideas?

                                1 Reply Last reply Reply Quote 0
                                • travisdh1T
                                  travisdh1 @wirestyle22
                                  last edited by

                                  @wirestyle22 said in Install AWX on CentOS 7 with Docker:

                                  @travisdh1

                                  awx.png

                                  Yeah I am just testing at home

                                  It's really sad that they are treating AWX this way. Basically means that Ansible/Tower is out of the question because they can't keep a stable code base.

                                  wirestyle22W stacksofplatesS 2 Replies Last reply Reply Quote 0
                                  • wirestyle22W
                                    wirestyle22 @travisdh1
                                    last edited by wirestyle22

                                    @travisdh1 I have to imagine that there is a way for me to change a user's password via cli that doesn't use awx-manage, if not then what is the reason that I am unable to use it? Not familiar with it enough to know though. Haven't found anything online yet.

                                    travisdh1T 1 Reply Last reply Reply Quote 0
                                    • travisdh1T
                                      travisdh1 @wirestyle22
                                      last edited by

                                      @wirestyle22 said in Install AWX on CentOS 7 with Docker:

                                      @travisdh1 I have to imagine that there is a way for me to change a user's password via cli that doesn't use awx-manage, if not then what is the reason that I am unable to use it? Not familiar with it enough to know though. Haven't found anything online yet.

                                      Obviously I've not had to use awx-manage yet myself. Did you do a sudo find / -name "awx-manage"?

                                      wirestyle22W 1 Reply Last reply Reply Quote 0
                                      • wirestyle22W
                                        wirestyle22 @travisdh1
                                        last edited by

                                        @travisdh1 went to http://192.168.1.x/api/v1/config/ to try the basic auth prompt. Same issue.

                                        travisdh1T 1 Reply Last reply Reply Quote 0
                                        • travisdh1T
                                          travisdh1 @wirestyle22
                                          last edited by

                                          @wirestyle22 said in Install AWX on CentOS 7 with Docker:

                                          @travisdh1 went to http://192.168.1.x/api/v1/config/ to try the basic auth prompt. Same issue.

                                          I won't have access to mine till I get home tonight. Poke me latter and I'll see if I can find awx-manage.

                                          wirestyle22W 1 Reply Last reply Reply Quote 0
                                          • wirestyle22W
                                            wirestyle22 @travisdh1
                                            last edited by wirestyle22

                                            @travisdh1 said in Install AWX on CentOS 7 with Docker:

                                            @wirestyle22 said in Install AWX on CentOS 7 with Docker:

                                            @travisdh1 went to http://192.168.1.x/api/v1/config/ to try the basic auth prompt. Same issue.

                                            I won't have access to mine till I get home tonight. Poke me latter and I'll see if I can find awx-manage.

                                            I found it. It's in /opt/awx/tools/docker-compose

                                            command still errors.

                                            travisdh1T 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post