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.
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.
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.
awx_task
wouldn’t recommend doing it the way you laid it out.
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 ?
Hi,
could you please help me on this.
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
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.