1

I have a playbook which clones a repo and executes a Python script, which uses s3cmd and os.popen() to run an s3cmd command.

However, it says s3cmd: command not found, even though I have installed s3cmd. Maybe it is because I have not configured them.

Error: "stderr": "sh: s3cmd: command not found",

So, how do I configure s3cmd inside the dynamically created EC2 instances.

[I already have an environment set for the AWS keys. Is there any way I can use them for this too?]

Dawny33
  • 10,543
  • 21
  • 82
  • 134

1 Answers1

1

Try fully specifying the path to s3cmd (e.g., /usr/bin/s3cmd) everywhere.

https://docs.ansible.com/ansible/latest/user_guide/playbooks_environment.html the environment settings can be used on the playbook/play/task level.

Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
andyhky
  • 1,798
  • 1
  • 17
  • 30