I just recently updated to 2.3.1.0. I’ve used set_fact before the upgrade to set my AWS instance ID to a variable “coreaid”.
- name: Save instance ID to coreaid
set_fact:
coreaid: "{{ ec2_asg.instances }}"
- debug: msg="the id= {{ coreaid }}"
- name: Set the instance public IP to a variable
register: instance_public_ip
shell: sudo aws ec2 describe-instances --filters "Name=instance-id,Values='{{ coreaid }}'" --query 'Reservations[*].Instances[*].[PublicIpAddress]' --output text
I set the fact, and it’s correct:
ok: [local] => {
“ansible_facts”: {
“coreaid”: [
“i-XXXXX”
When I debug or use it later in the play the value is:
ok: [local] => {
“msg”: “the id= [u’i-XXX’]”
What am I doing that is causing the "[u’ to be added to the beginning of the instance ID?
Thanks!