-
Notifications
You must be signed in to change notification settings - Fork 3
undefined variable 'env' #3
Description
Details
Not using galaxy, just adding the code as a role directly. Using the built in test command I get the below error (I see this same error when using aws-sts as a role in my playbook)
This is with Amazon Linux 2, not sure if it's relevant. Ansible was installed via pip ==2.5 --user
command
ansible-playbook test.yml -e Sts.Role=arn:aws:iam::000000000:role/analytics-ec2-provision-instance-profile
output
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'env' is undefined\n\nThe error appears to have been in '/home/ec2-user/sts_ec2/roles/aws-sts/tasks/main.yml': line 3, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- block:\n - name: create sts variable\n ^ here\n"}
environment info
[ec2-user@ip-172-31-51-166 aws-sts]$ aws --version
aws-cli/1.14.8 Python/2.7.14 Linux/4.14.47-64.38.amzn2.x86_64 botocore/1.8.12.
[ec2-user@ip-172-31-51-166 aws-sts]$ pip --version
pip 10.0.1 from /home/ec2-user/.local/lib/python2.7/site-packages/pip (python 2.7).
[ec2-user@ip-172-31-51-166 aws-sts]$ python --version
Python 2.7.14.
[ec2-user@ip-172-31-51-166 aws-sts]$ ansible --version
ansible 2.5.0.
config file = None.
configured module search path = [u'/home/ec2-user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'].
ansible python module location = /home/ec2-user/.local/lib/python2.7/site-packages/ansible
executable location = /home/ec2-user/.local/bin/ansible.
python version = 2.7.14 (default, Mar 16 2018, 18:20:07) [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)].