Hello All,

   I am trying to setup ansible script which fetches config file from S3 
and stores on remote node in home directory for User. In next task I would 
like to include_vars from this file but somehow include_vars fails to find 
file on remote machine as it always looks in 
my local machine.


- hosts: XYZcompute.amazonaws.com
  connection: ssh
  remote_user: ubuntu
  gather_facts: False
  vars:
    remote_env:
         ...
  roles:
    - python
    - uwsgi
  tasks:
   - shell: echo $HOME
     register: USER_HOME
     ignore_errors: True
   - name: Access file from s3
     s3: bucket=MYBUCKET object={{CONFIGURATION_ENV}}.yml 
dest=~/{{CONFIGURATION_ENV}}.yml mode=get force=true
     environment: remote_env
   - name: "Loading vars"
     include_vars: '~/{{CONFIGURATION_ENV}}.yml'
     delegate_to:  XYZ.compute.amazonaws.com


lets say I am invoking above playbook from user vikram include_vars fails 
saying 

file could not read: /home/vikram/production.yml

but I want ansible to load variables from /home/ubuntu/production.yml



-Vikram







-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/efcdc0d5-45d9-4ec3-a4f7-968dc50554f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to