# /bin/sh: aws: command not found on AWX

**URL:** <https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237>\
**Category:** AWX Project\
**Tags:** aws, awx\
**Created:** [May 27, 2021, 12:14pm UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237 "2021-05-27T12:14:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MySQL\_tute\_s](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@MySQL\_tute\_s](https://forum.ansible.com/u/MySQL_tute_s)\
**Post date:** [May 27, 2021, 12:14pm UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237/1 "2021-05-27T12:14:06Z")

</div>

Hi Team,

i have a playbook that copy s3 files from one bucket t o another bucket. the playbook is working fine from command promt.

but not from awx, its showing “/bin/sh: aws: command not found”

below is my code.

tasks:

- name: V3.8 - Copy files from Ohio Dev to Oregon Dev  
shell: aws s3 cp s3://{{ ohio\_source\_bucket }} s3://{{ oregon\_dest\_bucket }} --recursive --acl bucket-owner-full-control

could you please help me wit this.

---

<div class="post-metadata">

**Author:** ![Patrick\_Dreher](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Patrick\_Dreher](https://forum.ansible.com/u/Patrick_Dreher)\
**Post date:** [May 27, 2021, 12:37pm UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237/2 "2021-05-27T12:37:00Z")

</div>

Hi,

well, the issue is exactly what is displayed.  
Wherever your AWX is running - it doesn’t have the aws cli installed.  
I assume your playbook successfully runs on localhost or some other host where aws cli is installed.  
If your AWX is running in a container it won’t have the aws cli.

One way to do this would be to have a host somewhere with aws cli installed that your playbook uses to execute the command.

---

<div class="post-metadata">

**Author:** ![MySQL\_tute\_s](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@MySQL\_tute\_s](https://forum.ansible.com/u/MySQL_tute_s)\
**Post date:** [May 27, 2021, 1:30pm UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237/3 "2021-05-27T13:30:48Z")

</div>

HI,

So, can i install the aws cli on awx container, if yes, which container should i use to install the aws cli.

awx\_task or awx\_web.

---

<div class="post-metadata">

**Author:** ![Patrick\_Dreher](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Patrick\_Dreher](https://forum.ansible.com/u/Patrick_Dreher)\
**Post date:** [May 27, 2021, 1:36pm UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237/4 "2021-05-27T13:36:33Z")

</div>

awx\_task  
wouldn’t recommend doing it the way you laid it out.

---

<div class="post-metadata">

**Author:** ![MySQL\_tute\_s](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@MySQL\_tute\_s](https://forum.ansible.com/u/MySQL_tute_s)\
**Post date:** [May 27, 2021, 1:46pm UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237/5 "2021-05-27T13:46:13Z")

</div>

Hi Patrick,

really thank you so much for helping me.

i have a host that installed with aws cli. and ip is lets say 1.2.1.2(example)

but in playbook in the host section how can i provide that IP.

could you please help. on which file we should add that ip and provide alias name to it ?

---

<div class="post-metadata">

**Author:** ![MySQL\_tute\_s](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@MySQL\_tute\_s](https://forum.ansible.com/u/MySQL_tute_s)\
**Post date:** [May 27, 2021, 4:06pm UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237/6 "2021-05-27T16:06:34Z")

</div>

Hi,

could you please help me on this.

---

<div class="post-metadata">

**Author:** ![Patrick\_Dreher](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Patrick\_Dreher](https://forum.ansible.com/u/Patrick_Dreher)\
**Post date:** [May 28, 2021, 11:24am UTC](https://forum.ansible.com/t/bin-sh-aws-command-not-found-on-awx/35237/7 "2021-05-28T11:24:30Z")

</div>

Hi,

you can just create a simple inventory.

_[aws]_  
_hostname ansible\_host=1.2.1.2_

[https://docs.ansible.com/ansible/latest/user\_guide/intro\_inventory.html](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html)

If you have this in the repository that you sync with AWX you can simply add the inventory file as a inventory source. (create inventory \> add inventory source)

Then you run your play on the ‘aws’ host group.

hope this helps.
