-
Notifications
You must be signed in to change notification settings - Fork 20
Tips
Daniel Pereira edited this page Aug 26, 2019
·
1 revision
Collection of items that might save you some time.
Usually you need to install both boto3
and botocore
on the host so you can utilize AWS modules. However, you can stop doing this and bundling these dependencies along with your playbook bundle.
Here's what you need to do:
- Package your playbook using the
--python-package
parameter:
$ bundle-playbook -f playbook.yml --python-package boto3 --python-package botocore
- On your playbook, ensure that you get the
PYTHONPATH
env variable coming from the availableenv
. That is needed because Ansible modifies that variable at runtime.
- name: get something from S3
aws_s3:
bucket: my_s3_bucket
object: myobject
dest: /etc/file.cfg
mode: get
# Ensure you include these lines below
environment:
PYTHONPATH: "{{ lookup('env', 'PYTHONPATH') }}"