rawmain
rawmain

Reputation: 309

How to use awx cli?

Installed awx by docker-compose from official guide.

Installed awx cli this way:

pip install "https://github.com/ansible/awx/archive/11.1.0.tar.gz#egg=awxkit&subdirectory=awxkit"

Check its configuration

# awx config
{
     "base_url": "https://127.0.0.1:443",
     "token": "",
     "use_sessions": false,
     "credentials": {
          "default": {
               "username": "admin",
               "password": "password"
          }
     }
}

Get user list

# awx --conf.host https://127.0.0.1:443 \
>     --conf.username admin --conf.password password \
>     --conf.insecure \
>     users list

...

There was a network error of some kind trying to reach https://127.0.0.1:443.
You might need to specify (or double-check) --conf.host

HTTPSConnectionPool(host='127.0.0.1', port=443): Max retries exceeded with url: /api/ (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

It was installed by default configuration without SSL. How to change the base_url?

I checked the Authentication document, can't pass auth due to the https issue.


From the document, this way can generate document:

# pip install sphinx sphinxcontrib-autoprogram

~ TOWER_HOST=https://awx.example.org TOWER_USERNAME=example TOWER_PASSWORD=secret make clean html
~ cd build/html/ && python -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ..

But when I ran it got this error

make: *** No rule to make target `clean'.  Stop.

Where to run this command?

Upvotes: 1

Views: 4993

Answers (2)

Nikhilesh Kumar
Nikhilesh Kumar

Reputation: 1

You can do export for these variables as a environment variable in order to setup AWX cli.

Use below commands:

export TOWER_HOST=<awx-url>
export TOWER_VERIFY_SSL=<false or true as per SSL installation>

For more step by step details read my medium post below :

https://medium.com/@nikhilesh.singh192/awx-command-line-interface-setup-b4a211753f7b

Upvotes: 0

anish anil
anish anil

Reputation: 2631

This one worked on my system:

awx --conf.host http://127.0.0.1:80

It lists all available options without any errors

Upvotes: 1

Related Questions