Hi,

When I run the following playbook on an EC2 instance with IAM instance role:

---
- hosts: localhost
  connection: local
  gather_facts: false
  tasks:
    - name: Assume the instance profile role
      sts_assume_role:
        region: "eu-west-1"
        role_arn: "arn:aws:iam::xxxxxxxxxx:instance-profile/profile-name"
        role_session_name: "someRoleSession"
      register: assumed_role

I get error:

TASK [Assume the instance profile role] 
****************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": 
"Region eu-west-1 does not seem to be available for aws module boto.sts. If 
the region definitely exists, you may need to upgrade boto or extend with 
endpoints_path"}

Get the same result after trying couple of other regions without success 
(although the instance it self is in the eu-west-1 region). Which is the 
correct region then?

The role ARN is obtained via the instance metadata:

# curl -s http://169.254.169.254/latest/meta-data/iam/info | jq -c -M -r 
'.InstanceProfileArn'

Some details of the setup:

# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:    trusty

# ansible --version
ansible 2.0.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

# python --version
Python 2.7.6

# dpkg -l python-boto | grep ^ii
ii  python-boto                      2.20.1-2ubuntu2                   
all          Python interface to Amazon's Web Services

What can be the problem? Nothing obvious comes to my attention when looking 
in the module documentation 
http://docs.ansible.com/ansible/sts_assume_role_module.html.

Thanks

-- 
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/d3e8bebb-f74d-487f-8e5b-f7314297b110%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to