This has been resolved by adding a new task for the cross account role to 
assume from the same account and updated the account config with local 
account parameters.

On Tuesday, January 15, 2019 at 4:44:34 PM UTC, Kishore Ponniah wrote:
>
> Hi everyone,
>
> I tried to debug s3_sync but one thing I noticed is s3_sync module does 
> not have a destination path. It only has file_root and I ran this command 
> from the source path "aws s3 sync . s3://bucketname/xxxx/test/", it 
> uploaded all the files to the destination. Then after I ran the playbook it 
> completed successfully. Experts please advise if I miss something here. 
>
> Thanks
> Kishore
>
> On Monday, January 14, 2019 at 5:04:44 PM UTC, Kishore Ponniah wrote:
>>
>> Hi All,
>>
>> I am trying to upload multiple yaml cloudformation templates to a s3 
>> bucket using s3_sync. I have created a task in the playbook, looks like the 
>> tasks completed successfully but the file is not uploaded. Can someone 
>> please advise whether s3_sync is the proper method? If yes, can someone 
>> please help me identify what I have missed. Please find my playbook below:
>>
>> *Playbook*
>>     - name: upload files rxgt-ps-cross-account-s3-sync
>>       s3_sync:
>>         region: "{{ account_config.1 }}"
>>         aws_access_key: "{{ account_config.0.sts_creds.access_key }}"
>>         aws_secret_key: "{{ account_config.0.sts_creds.secret_key }}"
>>         security_token: "{{ account_config.0.sts_creds.session_token }}"
>>         bucket: "{{ 
>> account_config.0.account_config.stacks['rxgt-ps-cross-account-s3-sync'].params.bucket
>>  
>> }}"
>>         file_root: "{{ 
>> account_config.0.account_config.stacks['rxgt-ps-cross-account-s3-sync'].params.file_root
>>  
>> }}"
>>         mode: "{{ 
>> account_config.0.account_config.stacks['rxgt-ps-cross-account-s3-sync'].params.mode
>>  
>> }}"
>>         file_change_strategy: "{{ 
>> account_config.0.account_config.stacks['rxgt-ps-cross-account-s3-sync'].params.file_change_strategy
>>  
>> }}"
>>         permission: "{{ 
>> account_config.0.account_config.stacks['rxgt-ps-cross-account-s3-sync'].params.permission
>>  
>> }}"
>>       loop: "{{ 
>> assumed_roles_with_account_config.results|subelements('account_config.regions',
>>  
>> skip_missing=True) }}"
>>       loop_control:
>>         loop_var: account_config
>>         label: "{{ account_config.0.account_config.account_alias }}:{{ 
>> account_config.1 }}"
>>       tags:
>>         rxgt-ps-identity-stack-deploy
>>
>> *Account_config file*
>>
>>       stacks:
>>         rxgt-ps-cross-account-s3-sync:
>>           params:
>>             bucket: xxx-xx-xxxxxxxxxxx-eu-west-1-xxxxxxxxxx
>>             file_root: /xxx-xxxx-xxxxxplatform/ansible/files/
>>             mode: push
>>             file_change_strategy: date_size
>>             permission: public-read
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f9d6448f-03ee-4b98-8a71-9e976cf3fa52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to