# Install awx-cli, then what?

**URL:** <https://forum.ansible.com/t/install-awx-cli-then-what/34507>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [January 25, 2021, 7:23pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507 "2021-01-25T19:23:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Knox](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kevin_knox/32/3926_2.png) [@Kevin\_Knox](https://forum.ansible.com/u/Kevin_Knox)\
**Post date:** [January 25, 2021, 7:23pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/1 "2021-01-25T19:23:11Z")

</div>

I’m obviously without a clue here:

bash-4.4# pip3 install --log ~/install2.log awxkit  
Requirement already satisfied: awxkit in /home/awx/.local/lib/python3.6/site-packages

Requirement already satisfied: PyYAML in /usr/lib64/python3.6/site-packages (from awxkit)  
Requirement already satisfied: requests in /home/awx/.local/lib/python3.6/site-packages (from awxkit)  
Requirement already satisfied: idna\<3,\>=2.5 in /usr/lib/python3.6/site-packages (from requests-\>awxkit)  
Requirement already satisfied: chardet\<5,\>=3.0.2 in /home/awx/.local/lib/python3.6/site-packages (from requests-\>awxkit)  
Requirement already satisfied: certifi\>=2017.4.17 in /home/awx/.local/lib/python3.6/site-packages (from requests-\>awxkit)  
Requirement already satisfied: urllib3\<1.27,\>=1.21.1 in /home/awx/.local/lib/python3.6/site-packages (from requests-\>awxkit)  
bash-4.4# awx  
bash: awx: command not found

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [January 25, 2021, 8:28pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/2 "2021-01-25T20:28:00Z")

</div>

Hey Kevin,

Can you share some details of your environment? I’ve given this a shot and it works okay for me:

~ head /etc/os-release -n3  
NAME=Fedora  
VERSION=“32 (Workstation Edition)”  
ID=fedora  
~ python3 --version  
Python 3.8.5  
[yossarian] (fedora:●●) ~ python3 -m venv foo  
[yossarian] (fedora:●●) ~ source foo/bin/activate  
~ pip install awxkit 2\>&1 \> /dev/null  
~ awx -h  
usage: awx [–help] [–version] [–conf.host [https://example.awx.org](https://example.awx.org)] [–conf.token TEXT] [–conf.username TEXT] [–conf.password TEXT] [-k] [-f {json,yaml,jq,human}] [–filter TEXT] [–conf.color BOOLEAN] [-v] resource …

positional arguments:  
resource  
login authenticate and retrieve an OAuth2 token  
config print current configuration values  
import import resources into Tower  
export export resources from Tower

…

---

<div class="post-metadata">

**Author:** ![Kevin\_Knox](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kevin_knox/32/3926_2.png) [@Kevin\_Knox](https://forum.ansible.com/u/Kevin_Knox)\
**Post date:** [January 25, 2021, 10:24pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/3 "2021-01-25T22:24:25Z")

</div>

Thanks for the question!

bash-4.4# head /etc/os-release -n3  
NAME=“CentOS Linux”  
VERSION=“8 (Core)”  
ID=“centos”

bash-4.4# python3 --version  
Python 3.6.8

bash-4.4# awx -h  
bash: awx: command not found

The application may be somewhere in my file system, but I don’t know where to start looking for it.

Kevin

---

<div class="post-metadata">

**Author:** ![kdelee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kdelee/32/193_2.png) [@kdelee](https://forum.ansible.com/u/kdelee)\
**Post date:** [January 25, 2021, 10:44pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/4 "2021-01-25T22:44:16Z")

</div>

Try looking in ~/.local/bin

I’m on fedora 33, which is not too unlike centos8 and thats where my system pip3 installs it.

Maybe your $PATH is not correctly configured to pick up binaries in ~/.local/bin

---

<div class="post-metadata">

**Author:** ![Kevin\_Knox](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kevin_knox/32/3926_2.png) [@Kevin\_Knox](https://forum.ansible.com/u/Kevin_Knox)\
**Post date:** [January 26, 2021, 1:41pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/5 "2021-01-26T13:41:48Z")

</div>

Bingo! Thank you. Yes, it was in ~/.local/bin, and yes my path was not configured to find it. Great call!

Kevin

---

<div class="post-metadata">

**Author:** ![Kevin\_Knox](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kevin_knox/32/3926_2.png) [@Kevin\_Knox](https://forum.ansible.com/u/Kevin_Knox)\
**Post date:** [January 26, 2021, 8:20pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/6 "2021-01-26T20:20:47Z")

</div>

For those following along for fun, after getting awx to work, this builds a project-sourced inventory. So much easier than doing it 150 times in the GUI! Thank you to the whole team of people who make this kind of stuff possible!

inventory\_name=shared\_environment\_a  
new\_inventory=$(awx inventory create --name “$inventory\_name” --description ‘Autoimport by awx-cli from OEM’ --organization 3)

# I will show the find, though the code works easily from $new\_inventory’s json return value

found\_inventory=$(awx inventory list --name “$inventory\_name”)  
found\_inventory\_id=$(echo $found\_inventory | python3 -c “import sys, json; print(json.load(sys.stdin)[‘results’][0][‘id’])”)  
awx inventory\_sources create --name oem --description ‘Autosourced by awx-cli from OEM’   
–source scm   
–source\_path “ansible/inventory/$inventory\_name.yml”   
–overwrite true   
–overwrite\_vars true   
–inventory “$found\_inventory\_id”   
–update\_on\_launch true   
–source\_project 30   
–update\_on\_project\_update false

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [January 26, 2021, 9:01pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/7 "2021-01-26T21:01:22Z")

</div>

Thanks for the feedback Kevin 😃

Based on your example, you might be interested to know that the CLI generally lets you specify resources (like inventories) using just their name (assuming you keep them unique across e.g., Organizations). Try --inventory $inventory\_name and see if you can skip the ID lookup. The same is true for --organization “Some Organization Name”

---

<div class="post-metadata">

**Author:** ![Kevin\_Knox](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kevin_knox/32/3926_2.png) [@Kevin\_Knox](https://forum.ansible.com/u/Kevin_Knox)\
**Post date:** [January 26, 2021, 9:44pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/8 "2021-01-26T21:44:36Z")

</div>

> you can skip the ID lookup  
> Good to know! Thank you, again, Ryan.

Kevin

---

<div class="post-metadata">

**Author:** ![kdelee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kdelee/32/193_2.png) [@kdelee](https://forum.ansible.com/u/kdelee)\
**Post date:** [January 26, 2021, 11:32pm UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/9 "2021-01-26T23:32:31Z")

</div>

Great news!

---

<div class="post-metadata">

**Author:** ![GoMatrix\_Hosting](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@GoMatrix\_Hosting](https://forum.ansible.com/u/GoMatrix_Hosting)\
**Post date:** [January 27, 2021, 9:33am UTC](https://forum.ansible.com/t/install-awx-cli-then-what/34507/10 "2021-01-27T09:33:49Z")

</div>

I noticed this on Debian 10/11 too, where awxkit will install okay but you can’t find it in your path. Would be nice if it worked without having to specify the full path to awxkit.
