Unicode issues with Ansible 1.8 and up

Im running some Ansible playbooks on ec2 instances created by OpsWorks. Part of the automation reads the ec2 tags from the instance. here is the code for that

  • name: gather ec2 facts
    action: ec2_facts

  • name: get environment tag
    action: ec2_tag resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }} state=list
    register: allTags

Using that information I then do a group by using one of the tags. The main reason to do this is to leverage group_vars and do automation that configures settings differently for environments. In this case the tag name is environment. Code below

  • group_by: key={{ allTags.tags.environment }}

All this worked perfectly in Ansible 1.7. But after 1.8 the playbook fails with the following error. Is intersting to note that the automation works fine with instances that are not spun up by OpsWorks. OpsWorks does add some special tags to the instance. My suspicion is that some of those tags have special characters that are causing some sort of unicode issue.

TASK: [group_by key={{ allTags.tags.environment }}] ***************************
fatal: [localhost] => template error while templating string: unexpected char u'\x99' at 2600

I’ve tried using quotes in the group_by like this but with the same result

  • group_by: key=“{{ allTags.tags.environment }}”

I also tried using a different way of referencing the dictionary value like this

  • group_by: key={{ allTags[‘tags’][‘environment’] }}

But had the same results

I tried the recommendation on this thread https://groups.google.com/forum/#!msg/ansible-project/mLgdORSFspo/PXfO76QNfMMJ but still the same issue.

From what I’ve read there are some changes in Jinja that cause this behaviour but I have not been able to figure out the issue. Anyone has seen this issue or has some recommendations? Thanks in advance

I'd be interested to know how that character is getting in there and
what you expect it to be. u'\x99' seems to be a c1 control character
so it's probably not something that jinja should be expected to
handle. But the character might originally be a byte in an encoding
that was unexpected that was mangled in the decoding process. Need
more information about what is being returned as your tags to figure
this out.

-Toshio

Hi Toshio. Thanks a lot for the reply. Here is the debug output of what is being returned. Thanks in advance

TASK: [debug var=allTags] *****************************************************
ok: [localhost] => {
“var”: {
“allTags”: {
“changed”: false,
“invocation”: {
“module_args”: “resource=i-be204f6e region=us-east-1 state=list”,
“module_name”: “ec2_tag”
},
“play”: “setup.yml”,
“role”: null,
“state”: “ok”,
“tags”: {
“Name”: “analytics-storm-temp - storm1”,
“environment”: “dev”,
“opsworks:instance”: “storm1”,
“opsworks:layer:storm”: “storm”,
“opsworks:stack”: “analytics-storm-temp”,
“role”: “storm”
},
“task”: “get environment tag”
}
}
}

Hmm... So if I try to replicate this using the debug output of allTags
directly I'm not able to provoke an error. Here's my playbook:

You are absolutly on the right track. I incorrectly assumed the issue was coming from the tags varible. But I tried your suggestion and still got the same error. So the error is cause just by the group_by and not necessarly the variable.

I did a group by machine_{{ ansible_machine }} and got the same error.

TASK: [debug msg=“machine_{{ ansible_machine }}”] *****************************
ok: [localhost] => {
“msg”: “machine_x86_64”
}

TASK: [group_by key=machine_{{ ansible_machine }}] ****************************
Traceback (most recent call last):
File “/usr/local/bin/ansible-playbook”, line 324, in
sys.exit(main(sys.argv[1:]))
File “/usr/local/bin/ansible-playbook”, line 264, in main
pb.run()
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 348, in run
if not self._run_play(play):
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 789, in _run_play
if not self._run_task(play, task, False):
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 497, in _run_task
results = self._run_task_internal(task, include_failed=include_failed)
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 439, in _run_task_internal
results = runner.run()
File “/usr/lib/python2.7/dist-packages/ansible/runner/init.py”, line 1475, in run
result_data = self._executor(host, None).result
File “/usr/lib/python2.7/dist-packages/ansible/runner/init.py”, line 590, in _executor
msg = str(ae)
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\x8b’ in position 20: ordinal not in range(128)

I then did a test to remove the variable and rule out a Jinja templating issue . So Im grouping by just a word= test. The code is like this

  • group_by: key=test

And the result still looks like this . Same error

TASK: [group_by key=test] *****************************************************
Traceback (most recent call last):
File “/usr/local/bin/ansible-playbook”, line 324, in
sys.exit(main(sys.argv[1:]))
File “/usr/local/bin/ansible-playbook”, line 264, in main
pb.run()
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 348, in run
if not self._run_play(play):
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 789, in _run_play
if not self._run_task(play, task, False):
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 497, in _run_task
results = self._run_task_internal(task, include_failed=include_failed)
File “/usr/lib/python2.7/dist-packages/ansible/playbook/init.py”, line 439, in _run_task_internal
results = runner.run()
File “/usr/lib/python2.7/dist-packages/ansible/runner/init.py”, line 1475, in run
result_data = self._executor(host, None).result
File “/usr/lib/python2.7/dist-packages/ansible/runner/init.py”, line 590, in _executor
msg = str(ae)
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\x8b’ in position 20: ordinal not in range(128)

Also, I noticed the following. If I remove the ec2_facts module the group_by works

I removed this

  • name: gather ec2 facts
    action: ec2_facts

And then my dummy group_by=test works. So I suspect something with the ec2_facts module and something that is being returned by that.

So I ran the ec2_facts module by itself and noticed a bunch of unicode stuff on user_data

ansible -i inv -m ec2_facts all
/usr/lib64/python2.7/dist-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
warn(“Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.”, PowmInsecureWarning)
localhost | success >> {
“ansible_facts”: {
“ansible_ec2_ami_id”: “ami-1916f772”,
“ansible_ec2_ami_launch_index”: “0”,
“ansible_ec2_ami_manifest_path”: “(unknown)”,
“ansible_ec2_block_device_mapping_ami”: “/dev/xvda”,
“ansible_ec2_block_device_mapping_ebs1”: “sdo”,
“ansible_ec2_block_device_mapping_ebs2”: “sdp”,
“ansible_ec2_block_device_mapping_root”: “/dev/xvda”,
“ansible_ec2_hostname”: “ip-172-18-11-206.ec2.internal”,
“ansible_ec2_iam_info”: “{\n "Code" : "Success",\n "LastUpdated" : "2015-05-29T17:22:52Z",\n "InstanceProfileArn" : "arn:aws:iam::490606849374:instance-profile/analytics-storm-temp-LayerIAMInstanceProfile-THMUO658V6EB",\n "InstanceProfileId" : "AIPAJXHZ562GXJ7GGTNKG"\n}”,
“ansible_ec2_iam_security_credentials_analytics_storm_temp_LayerRole_R6SH1UXRFM8N”: “{\n "Code" : "Success",\n "LastUpdated" : "2015-05-29T17:23:09Z",\n "Type" : "AWS-HMAC",\n "AccessKeyId" : "ASIAILTF7KMSPUPGVVFA",\n "SecretAccessKey" : "/BZr+qf2xR7xXmTcm5vGk0WIIOR6DJ2YAVa/fUH1",\n "Token" : "AQoDYXdzEEsa4AOSuoTWhz2vnbbACC4R8QoXM8Lyrc/PQvQT9rlmAyZoujWxs5mBNeBl+u4IGc2T9Gn/kM59Bwvx9VcPERDmy+34RLnANUOC9a/2YafO/B3blNWinvCFSX1Z2oXsYw951vnkdpGcL/Op24FZCJbLFEwyJC90lFbkH+uHDujWUDoi6vRLwpdyNVTuu5sXgsoMFO1iL7+HwXFd4tBWoAVKaNyUvXV74EngXmyPqAaKVvkYYXIzK5XoCWbLawq/fCkxw6lqtS5waTP+WxkJSGHM0y+h9eGcQzJuz/g1sMajbsMWzY1Kn+FAubfxIeMTPo5wplVPnnE5WqKdwTxSx+OZagCfpcsMMvEgMTnEm40tsAiBTHDvmV/RJ1LGqq9qV4I6uydtm4WiWifI0CNVO/avaqzM8ggrkojoleIfAiNrWmXcD5u/RV+Ya+eOF3RnlETYrfvIQiJulNdB3/cpglucIMlUvrMmYmomBNJ0tEl/F7hcAGq90kkuWpnDeOjliOVKnzQy8xjrKheCfN09YiFOCTqewKGuG2eTzHlPHZdSVCQFrWK602Qyw6snAzm5XoD8EvtHj9Vwx6bsqZf6g+aVH+MXFs+I2sZPUgUuubYBcCbDEnaVXLB06nr7bxtpuuzLIhcg/MCiqwU=",\n "Expiration" : "2015-05-29T23:30:45Z"\n}”,
“ansible_ec2_instance_action”: “none”,
“ansible_ec2_instance_id”: “i-be204f6e”,
“ansible_ec2_instance_type”: “t2.small”,
“ansible_ec2_local_hostname”: “ip-172-18-11-206.ec2.internal”,
“ansible_ec2_local_ipv4”: “172.18.11.206”,
“ansible_ec2_mac”: “0a:f7:08:e4:ca:d1”,
“ansible_ec2_metrics_vhostmd”: “<?xml version=\"1.0\" encoding=\"UTF-8\"?>”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_device_number”: “0”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_interface_id”: “eni-19979451”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_ipv4_associations_52.4.206.110”: “172.18.11.206”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_local_hostname”: “ip-172-18-11-206.ec2.internal”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_local_ipv4s”: “172.18.11.206”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_mac”: “0a:f7:08:e4:ca:d1”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_owner_id”: “490606849374”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_public_hostname”: “ec2-52-4-206-110.compute-1.amazonaws.com”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_public_ipv4s”: “52.4.206.110”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_security_group_ids”: “sg-d2ada2b7\nsg-dcf86db8\nsg-ddada2b8”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_security_groups”: “AWS-OpsWorks-Default-Server,analytics-storm-temp-SecurityGroup-1DO5FALJZKU1J,AWS-OpsWorks-Custom-Server”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_subnet_id”: “subnet-7bfbc70f”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_subnet_ipv4_cidr_block”: “172.18.10.0/23”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_vpc_id”: “vpc-ba514bd8”,
“ansible_ec2_network_interfaces_macs_0a_f7_08_e4_ca_d1_vpc_ipv4_cidr_block”: “172.18.8.0/21”,
“ansible_ec2_placement_availability_zone”: “us-east-1a”,
“ansible_ec2_placement_region”: “us-east-1”,
“ansible_ec2_profile”: “default-hvm”,
“ansible_ec2_public_hostname”: “ec2-52-4-206-110.compute-1.amazonaws.com”,
“ansible_ec2_public_ipv4”: “52.4.206.110”,
“ansible_ec2_public_key”: “ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDaTf6w7IMh0tkq6Zyrk3EWvnBeVCCJ559dEM9F8372PEQ5ys5l/bjPDv5jSRP4wuzWtlPLRa/q/05qQJ6eLDG8O1MIQ/wq0E/uDiiVB1tAmAI1ea7rajstRsdWpCE6ozF7lGmKKFH4czMDhY/Zjw0x2/v4z6XUO+RdHi+DHmH3ZxgPIlmb2SUOwC2aIKO97AWbnOQZkAjMa3cVVVolKIv6NoLs9E6dvUdwUw+W4u2krLczW4iPDpPWDUGLo4/oMOHS5EjBQJ8mVyzaBD+PAkwp1sLcqSJvkQPrfipBZv58a7gjK88UMnq8q6AlrMH1yFHiuHot8cGMFrVnxux13Jg5 dev.ops\n”,
“ansible_ec2_reservation_id”: “r-fc18d211”,
“ansible_ec2_security_groups”: “AWS-OpsWorks-Default-Server,analytics-storm-temp-SecurityGroup-1DO5FALJZKU1J,AWS-OpsWorks-Custom-Server”,
“ansible_ec2_services_domain”: “amazonaws.com”,
“ansible_ec2_user_data”: "\u001f‹\b\u0000ª~gU\u0000\u0003Í|i{âÆÒèw~E\u001fÆo\u0018g‚-™Œ8y\u0001K€\rÂ\b-F99<B’AÖ:’Øœøþö[ÝZ\u0000ۓäÜ繓e ÕU]]{U·\u0018ô\u0006LU2‚ÐôÜ+DŸQ¥¶çF†\u001bU ­o\!giG¦¯\u0006ѹcn\fý’4󖮮\u0006Ûë–Ík\§óExìŒf23¶?›\u0017{gx7z\nK¥Rµúæ„Á;ëFÆ&:×lo©W5Ï}4ç¥Ò‡â×RøÞtéÏ\u0003U\u0007\u0000×sÿÒ²›j¸0l;Ô\u0002ӏݝÏL÷|¦†‹Òð~,\u000fù»ñT\u001c3üMShNûÃÎô¦Ç_WÎWjpn{ósu\u001dž{~¸ö\u0002+¬¼\u0002ÁöúÌ+ çËÐ\bªº\u001a©gð¨Rr,Ý\fPÕGå“?^]þ¥\Š¼¥¶x}\u0012^ñ¥Œ¾û\u000ei\u000bÇÓ\u0011õ™¢Þ›]ÚQßì0œ0•\u0018~Ü\u001br1ù@qT¤\[\u0006\u0001ðò<™¶ƒî7Ç”gZáÀ’›³"¼­†Ñ40fž\u0017í\u0013°þ°}7•›½\u0014Aäø\u0019\u00023µ=͚®U3: ¼Ç f¿ÏðS‘ï_W\u0016Qä‡Wç\u0019‚ªé†‘êjFUceX†U\u0003h©ÒgaýLuÔgÏ\u0005BÏ4Ï9¯_Pð§FÑ\r\nþ¡?×ë\u0017µ\u001dž\u0018œ³m#8‹æϕ×i\u0011:ÊuåoÂ\u0012{\r¶R*\u0019\u001bCCßý‚~ù\u0018\u0019\u0006ªªïÉú\u0014Õ~ùŽ.•\u001eUÓ^\u0006ÆÇSôG\t!à¨j#Ût\r×».ŸÐe\u0018\u0003\u0003\fA3Q¹‰\u0017E½xQ5\u0002“B\u0018ÚÐÏ\u0010\u0013\u0004^€L—€¢“\u0018A\u001e¸ro\u0003‡\r´2\u0002óq‹¢ ðð#€‡è\u0011û\u0018\u0004ÿ\u0019\u0001:j#H çáræ8f\u00040®nºó\u0010E\u001ejÊc4^ú¾\u0017Dg•ür\u0013o‰4ÕEª\u001dzùESÁ£p\u001bF†C\u0000<Û@°\u0017ü\u0018ãcÚ5Ԏ‡‹8 \u0019î\u0010¬MÛF3@´XFH÷Ö.úŒ\u001cÓ]F°!õ1‚­Dx~Â_À„Q©\u0011úùgf8@¿ s#ÒÎ\u001d/ÒÏ2©\u0002æÈÔÞ뜆‡ÿï9\t‹ü—ø\u0007˜þ\u0011×JÀ+¬–.ª†¯³l÷¤ôR¥\u0002KtÚÐ\u0016\u001eÿvò\u0011|,XF5xÔªµ/µÚéï(ç\u000fÌè\n|F¢o³\u001f,AÝX’\fÀëb\u0013„¤ëfvÐqôU\u0019°þ/6‹ä/ó\u0011ý†N~EÕy„(ô;Œ\u0000\u0013]ø+\u0007Ý\u0002V\u0000,ò–Ñ\u000f‰\u0016y%‹\u0011¢\t€±\u0001‰ÒðñÑÌ\u00113]›Ñ\u0002üe\u0014l§\u000báIˆLڑø\b\u0006=Å&M£ÚO 2Žã\tÌ[\u0006îO(´\rÃGt\u0003?„Xü—IN\b~Á‘]Õ§~àm¶SÓ}ôRBÍG²±ø\u0001v)áõ\tx·0BÕ –¸á®ÌÀs\u001dl-@Ù\u001cR\u0004TePù?Äáÿ\u001aã¼.\u001fL>ÍsÚXË36Xóa¹ÕÊ\u00193? Έ°¦à=º†\u0016™+3ÚBd54«„\u0003Ð\u0014¸5-<Köð\u0001\tÀyØ<ì\u0011Â5X\u0014d\u001cFà’\u000b\u000fv23\u0000Ҁ§ö–pÌEÎb3"øÀ:Ü\bCHʈ¤ûvf_!Z†\u0018\u000fÓ»\u000fÏò¾«IÅOŽ¡¯Äªø/\u0004\u0001Ý\u0006\u000b\tAbÀÑ*\u000e0 ²€X\rQ¡:•~¬ê†­n\u0011M¡7¢+d6+S3Îvñµ\u0018\\C\u001fHª\u001cUû¶·´uÈò¢Ôû\u001cç\u000bp\u0017ïJu·ku{vv–—\u0019O²\u0004ðŽž•(ÂPž[J’\u0007ð¬Þ\u001a\u00143S60ŪQ0ûý4\u0006¬¾£q\nVÕQ¥J7R7V) 8šÍ¼Ä\u0016KTùõª^ôø\f;4b´ÁÒÈqH\u001eo/\u0000­\u0001©\u000eýPŽ#\u0001\t2«89Æj¥ÚØ\u0010·(M+ôR\f2%3§ÉÌiöø-Ö\u001dæûÌ;>\u0015,\u001c\u0012â€dà\u000b \u0006Uéwñž\u001eçfa¬~}ÊDz¹\u0002ó\u001eÕøSÌ=\u0007´v?9‚̓£\b#Ïφt#®\u001d€;iÒ\u0014.ÌÇ\bÿgÃ\u001c|>Uþ'¬œ\u0016’ª1ž€c\u0003:ù#‡çå,\u0017&ðb;\u001cåÿ\tË\u0004G²ø2P“•?~$SQ5!ò´¸\u0014\u000bQ\u000e*\u001d})ìäa$Áó‚Àæaõœò¬\u0017\u0006ˆ-ˆ#ü Gt\u0005‰³¥\u001b-a\u0002À•Q2Ãé2\u001eL\u0018F´¢Bœ¯nÌLÕMu¨‚~Çþú7TŽ\u0001báœ|´Ã\u0019Ī8¿©š\u0010‹Õµ *€õš ª‘‡-6øxR?E/ÀFЧ÷ˆ¼!Ëî\u0011\u0019Óò\u0017ˆŒÇÿ\t‘ÙªÓGÕ1íí·,žÀ\u0005†¾€´ñ\u0010 ~PMHÙ\u0001Ä.\u0016‡°åæ\bXœ¸\u001d‚Åè^§ï\u0000\u000eýùç»ä\u0014Ü\u000fñƁñui\u0006Ä·\u00107œ~Ï9“}f\u0015\\.\tÿFœÜ\u0006K÷<FSÍÐb[Žq\u00146”ÇÑo\nÌxW[ÝLï\u0018žcú؀\u0002ßAÕ¯\u0010ãpiŠ,\bԆ\r\u0012ö\r\u001c\u0017}ØjxþŸx´úñßãO§gߟŸÐç\u0015˜’8«Óص·Ež\u0007ïӟàÔ1¿ÀÒU\u001dP›à´\u0018\u0002^!\t¼Ö¿°Îýq\u0014ßË\u001bž+‹~YæMDPä½ùxŒý{‚Ésn÷4‰žñ&Òǹ|ƒ/Jû‡\u0004\u000eÇê”\"R\\íÂèہ0™š4\u000bHږnüpUœ5$\u0004þ€ˆ$\u0013å[«!ÉuqV›\u0005ì³|¢ðkJ\u0014ñ Sǃ f¯™gö±\u0015Ó½&û*\"Ȥ²t\u0011\u0019Cºj8¸jò\u0012g]ŒË¥\u001cø~â^IcFŒ‰¬—Ö\u001eÄ\u0014q5s¦ŸÇÀAPáåC\u0003ÛN)\nT\u001fU’\u0012\u000b<¿Ç1Üð¥‚\u0018žßUO•\u001e@›ªm>ã•pa—Q˜Ë¤+9€1\u0014\u0006>ÂUX¥ô•n±8„ÏŽêÂþõ¸\"É/zV³q\u0001J¨Ê\u0015¢dU݌“Å­AÊZˆs\u0018@2Cà\u0000ÎO!=ÅIgì\u001bIî™UÄ8‡vp\u0012ŽkÀ!A0.<S¦þ òs¿–9^\u001d€Ã%.*Ž~¥Ä€vJµtÝØRpÁ€ƒYœÕ§A·RJ}\\ì'ÿ\u0002‚8 î\u0010ÄNò/ à\tÀ\u000eA>Úü\u00054M\u0002†ú\u0018\f#\u000bo‚sÑÒµ\\Ü6ÐÍ0\nÌÙ\u0012K«R\u0002ó*\u001dóúû\u0004%-\u0015Œ+iøªfÆ ¤?SàIα}@Œ«Îl\u00031÷Lÿ\u0007„½ˆ\u0001\u0005\tèilc™\u0011\u0017Z$Đ€ÄÄ\u0004÷F\u001a\u001f–\t±Ð{$ӈÞ\u0016\tY„”o°\fÂýîJRÚ\u001fÔò$P‰«E\}vã^Ší©úÙ£¡{à÷\u0004Úvæ\u0005ós9;7|Ã>ÿ|nÖ¿|&ŸÓ8]ý\\ýræzj -Î\u0000g%vU¥,‚M‡ãé}S\u0010 à\\WòB#RIÓ H¨»hüþï3ê·úå“ T\u0004çR¿á\u0004\nû†#)\u0005äJ×ÿ\u0007\u001c.Œ~/\u0014\u000eG¸±]\u00027²Â\u0005ÙæÌԖP¡® z{¾á†¡|ƒG\u001bÇ®å¾ v”|Û9û÷—\b–³-ý%ù+Ç_æ†\u0013Ò_ò¡âÿ\u001brÉÿöHÅ]ô&{¶SðTG*õÖ’³#œ¿\u001aDwÁõz‰-+ž®\u001bSœü\\ï§ÐÚ~\n}R#™s\f–‹#e¢4ª\u001f‡Þ2Ð rÛà\u0004 Нü‘a©î¨ Ë%ØU\u0016\u0002@ÍáÙY¼\u001b\u0012\u0006âç(\u0003¢‰=MŒ\u0006#¨†ö‘üE\u0004Õ¥\u000b¾ð¿BÍëÈÞETÄC\u001aB¸Áõ÷¨úVd{{™ôÿ1£\n˜þöÆþ:=߄é/+ã?åË+ë§äý\u0017\u0018òOPÅÇ\u0004qäú¦ÒŽï\rÓê5¹)Ë\u000f9án®]ðªnd\u0004ªFÚ\u0005G«î[s¨\u0011ã“iÒ\u001eUO\u0004_UCF\u001aëÔÛsRW\r^{\u0017\u0010ðÇ$\u001aä½>.$qà›‘\u0017BAÚ½+GÁ2Œ¶I¹™1»Œ~ÿéÍÀû\n~\u001cZ0i0Ãc‰|Hªö\u0001-ÓßoEšùó®]Ãòý>%9ÔJJ¼\™{Vʐ¼ÖÂÜO\u0010Ëü›MғãÍÅCŠ~ §\u001b y¤wXn§Ç\u001fÔaêû&\u0001i‰“[\b a¡%^+΃‡ÝfoÚíqÂø:Ž˜ÚÂx<÷\u0016ªy\u000e o\u0014–³º&¹jà êÇF#½rA¿ì&îôÝÓsC«= ž»›–Ü4¸¸¸x}î®\l\u0003ÏH\u0015\u001boÑ\u000fŒô@\u001bŽIHɗŽ\u001aZˆ¢~ü±„ùž»x±w— rtST²©\u0004\u0016ßpø€ÒL™dáñÚXâÂ22\njX¥³3\t\nÝàô±¡Oñ\tl6\u001e™Žá-£ëÏÔÁÔ)T\n`3ׇ½êÂiÿK5Ã\u001d”Käè§\r\u0019“‹lã1ò°B ÇÀs0ßV¦·\fÁð\ræ\u0013@æ\u0017<B¶„¯L¼³\u00069ˆûV\u0000¡£\u001c\u0005ØÛ\u0018žSʺ: ‹\u001bɽ ÝÆÎÂ\u0005iQ\u0013Åù\u0011ßPù¶ù$+,ƒ×/“¼ð}˜\u000fÿʎ\u0015\fw Èåž\u000f\bªG\u001bG\u0012Ü\u0002H\u0001°FƇéÙ©($±DqŒG|»\u0001þR!ò •j/¸}à‘F:ÈØW\u0003p›\u0010>JƒæÔe„vwÊ3\u0002ßcÆ×_JPÚô§BoÀ\fEáºN•n†2×\u001f6o²1ºF•²ëBer¾\u001cF°\u0005P€l.ˆmzÏ3lïázoã\u0005}\u0011Ç ¾©À<\b×8îc‘ˆ!ðæ\nP8éþ¹ÝeÚwcq€¯Èü‚O±~>²\u0006<°ÑÏ)M¿$ͱøO5@?\u001fl\u0013\u0000¢\u001c¦dg{€Kô³Ðä;Œ0Í&ÆD¬¬\u001c“~ÁTcba,­›É¡k\bå\r\u0016\u0012®¼3{ƒÐÒsNò\u0014Gò9É)ÐÇTFä´\bv;Ìd\u0016€\7\u0004\u001aã’\rÚd-ð$PD{ñ\tnÁoÄ\u001a\u0002ø½3ÔD[@2\u000fd3ˆ´5‰\ÚÏr,<1»\u0003‘>‹¯k{\u000f¾\u001a-ÎPï‘8ú9$ n\u0001h\tõÒ¿O„Á=\bˆlÃFÍYèÙØïaPLfþB\bl;ÕÖk”S§˜\u0007\u0001\u001a¨\u001bÓ\u0001VºKg\u0006$x©º\u0017\u0000¿ÄÓ#$ÄNí¸¹\u0014@@‘ñ1’çêa\f¼Ì‹p_rgdÊ:>~N<ç\u000f±}á-ë™lHÎ »hÕdVby\u00181\u0006.ÐP§â¥\u0017h¼ðÖ1ÃhùøxF´\n7\u0013ã8\u0013ó6:"åX\u0002„Ü8ÅÀ“pA\u001cU\u0000—ù\f\u001aâ\u0019¡[‰ €‰´E‰$I>ÐG‚\u0007°„M\b/ö„Žè1æN¸ gÞ³dݳ\u001c‰\u00183¡\u0012wm1\u0005\u0018ø۬ҙªf(FX ŒÌð\LÇáÚ1;îAþ)ïT\u0014Àv!¶ìô\u001f\u0000\u000bª\‰Õ²’)3‘“\u001a¾n6¥ø¤ `9Ba2±<‚Ïö<\u000bòG\u000bŸ-½ââÎ\u001e’?\u0015 Ÿø·%ön\u001fOwW~NþØ9Á\u0017r 9w—SÍÉ\u000e;â¸<MF¯+•Ý\u0018þž\u001cå&#`øâÆõÉ\u001fµ«j¹Ã‰y\u0005\u0006Ž aù\u0005³\u0010+©j“Ë\u001d¸t §ª\u001fãæ|\b#})£ò<÷Ñ]f_j¿\u0010\u000bu—6>r‚bøë)¾Z“\u001e¼üö\u001bªn0šÜ\u001aøL\u001cR\u001e\fW«iÊøgr-æ+!!ÙÅKù§ü±MƂ}<»£\u000frǧ”RR>IAÈ©h¥\u0002tä+ øÊ\u0015ÃóCþw„y•ì’Ü^ñrù+\u0002¦áøâ\u001a°ìß’÷M¡\u000baý\u0017r.¶»›šo©%âMixÙÝúÈÝûJäæ„sØVœ“$l|ÆÀ\u0018\u0016We„‡9ÚÓqܧJõ\u0005?-g\u0015f²=\u0010/ÊáÁNnw»\f¢ßwF\u0019à3wLÊˑ‘ƒ¡HµŒØzöâ\u001163\u001bç¥é@\u0012\u0010 <v°SRñ9w–wœÅGΒÜ-\u0002¼ö£¦žF–(~„Y\u000e\u0005H\bnv\u0006^4ífƒ¹.TP]UÃ\u0017ŒðW3:Û¥À8±ÎÝùÈs2&ê\u0018/ã’ynÆ#9~&’£x\r\u0018É>g<NVÀ¡\u001bÖ<’ª¼d.¡LӼ¾~̔&Eý‚/û\u0019±qh¯á,Ÿ‚-\u0019_Q ÞSñøòƒ0ê\u0011Lv›ùÇ\2Æ’ÌÇA€ÊSpZPë\u000fè${\u0004rˆµ\u0001‚œãÜc¶³Ýê©}±Ù\r»˜\u0004BÁÛk\u0016¯\u000bÂÿó{¿.r\të’Ñ!@\rU\u0010¦æˆ\u0012Ü7ÛwØÙB Ûׂ\u0002±÷©¦"Ç\fôBN&íyì}:ñE ôP2»fÙ\u001eŠœÀð׸ЂJE\u0010Çؑ\u0013µS[\fŠ\u0003ϔdIE\u0007AÆ!yˆ½Dq\u0018‡$¬ŽÙ\u0017¬Ç;ÿ“‚\u0012UÂ=ì*[9¯ Ê\u001fI#›cèt\u001f)¦ázOß^ÎSt¤ÉUÞ¹™t\u001cC% \u0017â¦áB¥!†ïd\u0001³€$BŁ=\u0017Lr’H\u001eVɹ%”Œ\u0010—hœT‘{ŒÉ͉\u0014\u000bý&\u001a:ÆC 3|ye.\b=Y÷[ÿ1Á“<fš%.G40_Ï\u001cUÁv\nì\u0007\u001eØSh™¾oè‰þÅ·Z\u0011UÜ\u0003\u0016Zºf|\u001e‘|!þ\f»Ž2ÉÂð­Ù;\u0005; æ\u0014+ˆ\u0006–ƒ½\u0017üS}DµÔ\u0010c)g;C{ˆ\n†Eð\u0014å_ʑ:ÅLÃÝ»ë“_K¹Ä\u0001+Qú(¾SB\u0015ù³’¯ŒS`£„ñàCv¨s¸Ò=ìîb\u001cã´¯†aÆèØßd\f/’–‰›°c\u001aæì<\u0011µqÀé¢ç9ÍI>Ÿ:e‘\n«ê¾zđ\n?ÉÇ©\n\u001eH\u000f¢R²\u0013F«Z´Tí˜À)n`Oñ\u0005 H¹È¤ücˆ`¹ ÁVâK\u0006×ø\u001aß»{‰¯6\u0016\u0016À\u0014Æ÷tÃÞ\u0011ý(HýWÐ4Èúß\u0016ö.|<\u001a¸VÐâ7¤m¸s Š4™ŠË j\ªÅ"\u0004ØT€\bVL–HÄ\u000bzx„{q‘dè„Añ\u0016\u000bC×i¼®Æ\n’ßæk+çÿI_æê\u0013RÏQêwk/øJV\u0014»¹ÿ\u000e°\f\u000f¬!·ÜK\u001cãñxNp‡J’Ü¢„êŠÈ\Þ*èvÁì™\u0005Ù¸¹™ªÎó\u0014ò±iü\t7„\u0001\rŒ¤©x6å[™°©Âüª©Wko2 A¿¿ì
[%ƒÕÞgö¾š\u0015ù–¾9ôÑÜÑO’älÿXÍöW%3ö·ðrºÇ}zW¶\u001cGGiù\u0001bQ֚ þ§\u0018\u001av±è\u0003Òp—ÚŒâZXuIù®†q\u001a^ìI‘j—¼t\u0013á;F M\u000eŽt¸¬-a#:RÆ¹\b}´bIú\u001eÇ\u0012í´åœ÷`ÉXåH²\u001d?I«¾<nò\u0006ÀÜUíëq¯\u0003©Õ —À\u0010’É6Ã돹7\u0005ðc҉± ·®\u001aä °Ã~M|—1kð‘J50\u001c/2ª¤üÇH\u0012ªÓ¸å]dä\u000fhµ3v\u001a@Ü\u000f‚]¤ý#€þˆ´ƒZ¼\u0012IX†sÜ\u001d\u000f^\n\u0013wԕñ†Ëqõ¾Ûúoÿûû‘B.~£\u000eA݁³MìK§écv /•ø¾ãÎÉÚ}/™É#)ÎË44^\u001cÔ\u001dO™0hœ8c\u0011ØD0\u0007½Üý ‹{%E\u000b ÜI)±$Ò)KK\u0015¢8I7ðšJ\u001dq.Â÷\u001d¦wy¯›æôa\k%÷3\u000f˯\\u0003lŸ·{¾xG\f¾1Ÿ°\u0001}\u001aèô4²{ðéSn89#Œâ·N²mÇo®Ž$ˆ_Òægꘒ—¥Ê¹)™—Œ‘Þ\u0018¶ANÃÒð\u000byÓ®5¶¯Ä)(>‰y<ÐñóïwÈ?à\u0013Ðe\u0010ššA¼V:~DCv^3V¢½³­Bí”iQ,žøõŠLF{jój†óªƒæ\u0012OŒ/ìîÈxÕ\u001f“?%ò/\u001aà«$3üjp©´^`$s#òü(\u0004[¾Ò¯‚+ûºZ^-®ÖeÜ=&\u0015\u001eé²iø6Rù$\u0019+ƒ—&«•µrþ\u000fÄϧ}˜”mÎ~—\u0013þäÍ2>èÃç\u001dWÕJ%“ÝO?Å藯 OÌì\bò\u001c\u000bw¸\u000fðÚ\u0019Þ݉Ҏœß:€\f2ÈÃC¬\u0002ŠC‡q€+Êp\u001d\u001cv\u0015P\u001d¸Þ\u0003Lú!¦üQØQd¹FÎ\u0001¾u†¯p,W@T\bU\u0007\u0018\u0016\u0019\u0006ÒzN>'çú ©ß§\u0013ãbOLî°ÆA2VR¨”°é—\u0000əFæ;\u000eÓyäF¨j¥¸9[lÒäZ%ÇÂÁQë.‘‹4$ðÞ$q«\u001e¹ÆúØ\u0019Wz(\u0002Ö\u0018î\u000evH§±„öÆq^òîA-u.\u001eGø]÷æ¤jºÏ2)¹_9©.ãS§òI’\u0007à@øîkóÉQüÀ[\u0011Ó\fÌù\u0002Š\u0000[Õâ#"\r\u001fÑãû臭?€sV\u0018ÿ\u001ecp–ñ-Gïßvò\u000eîpébß\u0011_yIÜ5I \bPšþdW;THÓ6«gß{|“©)\u0005$¹\u0001ÌF€5-¾Vã\u0007Æ4¾\fUHdwñ\u0002\u001c¿¹q¾›v¶ul\u001cßs?ñ\u0011>%‰á\u001eº¸ÖMo¦ì?,¥—\n⟽8x\Ú»Zz8£Z­–®ð;ºxù+’¾;téÊÔaÇf´½Bj]Uk5ú¢úe¦\u001bՋƥQ\u0019\u0017TUoÐuêGu¦i”ZºŠ9”]\u001e™Î Êà\f÷\nýý\u001f¥8Ä\u001a͟¯Ð[¿,\u0001 P§Fá4S™ÙR³Œè\n\u001dYžÌ|sý•\u0011̼\u0010Ø\u0012¿ut•ÂN“7~¡:›“Ÿ\ɐ\u001c™c¸ºïA\tyŒ†wÞ\u001c>‚\rßæ»B\u0017\u0017õÜ39³Mmj\u0019 ®ÍL\u0017{¯?« ûþ˜ŠúcºÍ‹ú­`¶F’x;€p=\u001fS’\u0012?£î\u0004Ѿ\u001dYöבØh+µh£v"Ÿ¶ë\u0000>`n[¢(uF"{?¢X~È°ÜX´Û£šÞÇßy‘©\u000b’§Éº%l#e|c?óÂâ^•”\u0016€skÿžwí¶Ð½½5Øyí®Þº0ÄE ÉëµÞY¬EKŠ$Æ\u000fyË^ŠuÝì×\u001a]¹Ë×\r» Ϙś[~(±O’Ôj)û¡O-XNj)J]±Úvó‚“}þ®æm\u0005Wj+\u000f-Ys¥Ú˜¾õtJ\u001aa½n1\u001c#)“’öŽ·ô@¡è‰n±ªÖmÝr4ÿ4±ù%góm¾Î¯\u0006Î¥ÂIöZ|Ðîø®>\u0006pÉ\u001e¬8ùÒ1ڗ¢Ú¹XñTãNyjÙ²«·\u0007\u000f\$>ó̈îmùš¯×.뺨8cÖZs”Ž›cƒz³1s}êJ–ú¼àåö¥4\u001cy[îiñ0”ô®4¾\k‹h ÒÞÄV.ø’NæEº;\u0016x\u0006ÀgÔb(¸\u0013ÚpYÓ°ýá¸#Eª³ðaï‘(,zz‡{ž\u0017ƒ\u0001µÙjLCi[‘/¹¾3kG]ÌùšRç\u0005ݟ؋±ø¤¸\u0012\u0013ِ+>÷iŽ‘e®&8—} TÐ\u001f\u0016Û±|¹Ò)¥1\u0011\u0017œ,êÝxõgÉ^¨3K¢Föünä귐^ð#±w—¨\u0014+X£¹ÈJm±ozLÄʱ:Ⴔ=¿¾Îk’y)Õx=Ç"Å\u0000ÎÛ[ÉbE~Üêó’EpöG>Ö;VcXPU¶5¦8¬_ š-Ž¢Õ±Ëº\nó%ÅyC£Ä\u000b¡fË#AS÷0x¢~mK¹Ù\}b^.yzAéu4‘š[Q°ù\t-FVt+m/{¼ dY¯)ló\u0002óø\rõ‹uO¼“åÞfl)]µ¦srWiÉnk=\u0016t\u0011À’µ[qö¤ˆ#K§fÏ·+Y\u0014eëXýÞÓ=LüÚ£x†\u001b\u000f,ý«P×Wz]ê(ÖB\u0019ÜèÝÙ\r·\u001eʍϪÄÓJ’¼\u0010¥ùJ\u0012¬L÷°v¿¡~mç²’X\u001a÷ào&\u0010c\u0005kaÏdßSaï3‰Á{\u001fwù’‰Ö.„\u001bn ¹­¡,îÔïuÝ\u001bÜñ¬ý„S&«±\u001a?ë]±.]h–½šÕõŽ!³=A²»|í²§ÑÊDv\u001a¬ÎÜNvºwۚQv\u001bÀáãó@’\áyBI’\u0012è\u000e³á›^À×í5ßmI’Ì3Š-9üÍ ¡uÙ¥"CöþÄ}å¬\u0010ßWšH¬­ty[îðâø©×à묪˜áj(/"Åџ\u0014[7\u0007NC4\u0004f«t\u0006õö\u0013×\u001b<\f6²ãã²rò¬Üs”½Rž¬õŒòž9A’úÏüJ±Xoæpƒ™4i\bOz{â\u000f\u0013™Ùò\fU\u001fÊþӘ¡ñ=ä\u0019s¹\u001dt$Neì¾èzwœl«#mð]{ÅuX‡ï|Yó\u0016\rY\tû4“ü !Ø+­s»€\rÜ`¿ò¼`ù\u0007¶.‰ú°¿ºŠ³\u0018Od~Ìßè–推‘0\b$،1òñ\u001c݉öB\u001av\u0016AÍîcâ­KAdù\u0006omLõ\u001fpOz]|Zl8ûÖ\u0004Ÿ2àjÔVµ|Ž\u0017lzfќÄP\u001b^\u001eÕÇuö\u0001«\rƒL‡mGÚrî‚ážõ\rÿÌ©³Nã~FqÀ,±>²•­,qîÀ\u0001¿dmdÔP\u0004\u0005\u0007p\u0005Vçä0\u0018Ü\u0000\u000boF\u0017\u0006ãß\u0018"oiTã~â.,m\u001cÞI ‘wÔÆæEΕÁÀû5º>\u0016”\u001e€\u000b”¶\u001aÈ4£‹!¥°ìý̱¶BÝz\u001eÐÖ3Ïú¬dÑ\rÉå·ã›\u0016#Ê_6ƒ:{£‚TÆ,Ëaƒmú¼l)¶Üåº\ns\t¾µeIÎåhò\fòw%ÖxÒ’r‡–UŠ^‹7<\bì–\u001aI`qVÔÀ¬£\u0017–¸\rëâöҜ<ø\u0012o{\råI7Ç2\u001fµ\u001dΙԕ@ª]vu‡\u001f+7\[ao—ŠÅ›3GzÆ&#zõþó­0ë¶\u001eT™\u001fLč\u000fÄY\u0002ÃuÕö%«:›Ò¡ ~»Qh›\u0005\u0007ö•»Ñîf\u001d\u000e¿¤ÙZ\u0000Ä­µšÏŽÙÞ Ö±ë‚¸èßÕù\u001a_Sn\u0006Ž²\u001e=µîew\u0014\u0018Îm}\u0000ÞAv•g]fYÌùî„\u001aÕ¹žXÛ¬\u0006ÝÖVdx_lú¶â(Ÿ\u0007´/÷k›Ñ_\f\u001cŽ\u0012é\u0001-?̃\u0001}ëBtÇáH¥[m•º\u001dhu–Ñi~9–Zw£úíDé.>Ä0\u0000OÃõ뜪´#^\u0013£!ðc«>,\u001cáæ\u0016·\u001c†2ËiF_·¹¥!²\r]n\u0000\u0005— Þ\u001eè\u0002[7º¶¬>)“Tæ\u0003Z¡µ.ߓ\u001e\u0014ì.\u0006ÖeC­ûàö\u00070պӝ¨’3½Í¨ÆÝ\u000f¥ÉJcíîH^\u0004bÍæUJZjÂh+Ⱥ=°\u0017÷˜óö(\u0018É\rŠ³øñäáöaüpK÷kTmB±ÊXò[²°\u0010’ÎæNn‚ë,ú\u0002s;\u0010jÑr,h5Ì:gT\u0007­[Ê\u0016\u000b\u001eƟÌ\u0018».=´\u0018¡ËK`]®f‰ôÈR|\u0001‚–aÛ\u001b噿\u0010\u001dÝ\u0007C^\u0011¹KÑ@º}h[üV§n%¾}ù¬Ö[+Ãå–ÚöÒâ:‹‡1\u0013\u0005S)#Ùç$W£¹º\u0007ùÄzƒužµ;3Ö^ßÕç›Á“Ô\u0003[¯I\u0012×\u0003Ï{3\u0010˜g®æÝé7"ØAëN’ºÂ\u0013Ó\u0010ºÒí¬Æã\u000e—`]¬8¡õ\fAJ\u001aÓÚÚ\u0010/-½;€ØÖªs¶/©,ÿ\u0004\u0012Äî|£Ñ \u0019\u0018ÕnZ\u0011Ø\u0003I\u0000×þB³¼­ñÄwea¾\u0019=ñœTk°w5«.X\u0014(Š\r–Ö\u0000\u001e°cŽâ¨¡¼aôÎåf°½Ä9”üÀ>HâåWðÛ£\u0019Ò\u0013Ù¾›=@Õ&ëNÛ¢©\u0001%=‰bÔVh–1X~#Š\u000b^µÖ´V“\u0018âimIzÐjúÓ¢\u0007)\u0001«\t\u0013š»a]NôG3ˆ¼ãº~\u0007f²\u0010\u001e¸á@Vı»ØŠµ/w\u001aEä\u000e§¦Q¶%<ñmHri•Q\u0006:ӰǬÿ\u0015láiD-‘¸ù<æς#҂³¦@ÐP\u0007m\u001c\u0012 éíPÖV“\u0007žU\u0018e¢\bÒj\u0004é;ïÌÁ<Ø­ 2Ԅâ•qG\u0007³á¿ŽÝ\u0016(ï†Ö::VZYÒi\u0010Êç±Ì\u000eFVo¥ËÒP“°Sž×\f†ni5íò~äÅù(\rùö.ÿÁÄ\u001f¤@\u001eäTÚB\rls/áG•*þÓb:=\u000e݋­~¯î˜\t\u0019Ä\u0005à ×kõžš\kn}]XfçrMµš#†m6‡íæèK\u0013?oÏïà3ÓtÍ\u001f\r°¯ú §¶W\u001ds}ù™µÈiʶÿðI½칓gÓ¶¬OÍIÝ`?»æ“?ªiN]1\u00065Æûª°Âª®ž;†\u0017r­fX‡È±¥‹\u000eÆñcoæžoÖ\u0003ïñ“9n­LgS¿ïܱÏÜ=ÕZL.·ãÏÍ\u00013ØDÎW+ìΨ¹½vXã\u0016ª }±Q$šÅ8žMYˆúŸ\u0015f»jϩޏÁ¦ãК1rnj\rã4EZ\ôo#îÑ]k\n?¸0ڟîî.G`˜ëÆBÆ8V­\u000b¥Q»\u001d\f”\u0019Ó¹\u001cLÚý­.’—+YÍíˆrç·¢z[ÿúãm8³ZÒùm£¥\u0005¹63=ž¶>-0Ž\u001eÇ{Ýuk$^Ê®p¾ù"â>¯Ö·³\u000bïóª¶hñt·Ö\u0019ßô×[åÇuû\u000b#u?=¨òÄ\u0017éù¹;fÈ\u0015CuÔ»iŽš-ü™\b‹án\u000eåW)]‘wëgF´6\fwŠ_¸‚r?îaá_\u0015[º\u0007/m$/}\u001dvxºMî¦Ï¤¿¯tü†Òëm“wÞ«8Ç/üœ\u00053TåQåoTؕ´Ó’l ÐÌI~•\bUÒ\u001e]úKFPÙÝzʶž‡\u0010Ik(ù}Áû¸Ã\Aù†Q~v;¾NæÃçô]·äÇ\bM\u001bÀ^í\u0002åqà\u001f¼È‘W\u0010Jî’–vïüã“U\u0011Šzü‹¨\u0015TØþ·&òG?»\u000bEéo\u0010\u0016_Ÿª”ŽüâI)iÔ¾ó\u0013² jÿ\u0017õ60í4W\u0000\u0000"
},
“changed”: false
}

I need to investigate how that is getting there. But I think it may be the cause.

Okay, I took some time this morning and it is indeed the
ansible_ec2_user_data that's causing this. Inside of that entry
there's a "{{". That's triggering jinja2 to try templating the value
in the string. Because it's not really intended to be templated but
filled with all sorts of unicode instead, when jinja runs on it it's
finding that the format of the "variable name" is invalid and then
creating that error.

The easiest workaround is probably to figure out why ec2_user_data at
your site is being populated with those values and try to get rid of
the "{{" in there. From the ansible code side we have to figure out
what the right thing to do is. bcoca thinks that we probably
shouldn't be templating facts ever but that it is being templated in
v1 in some obscure cases that we're running across here. We may be
able to address that in v2. We could also add some boilerplate in
somewhere that we process the facts to escape the "{{" but if we do
that we'll have to make sure that facts are always templated so that
any escaped "{{" are unescaped by the templating. A third option is
that we actually do want facts to be able to return values that can be
templated. if that's not the current behaviour we probably don't want
to add it but I'm not sure if it's usually the current behaviour or
not at this time.

-Toshio

Thanks a lot for looking into this. I reached out to AWS and they explained that the UserData is encrypted for OpsWorks instances. That is why we are seeing the garbled text that is causing the issue. I asked if there was a way to prevent this from happening but have not heard back yet. Im waiting for their response. In the mean time we have reverted back to version 1.7

BTW. Why is it that this does not happen in 1.7 but does in 1.8 and above? Does it have to do with the version of Jinja 1.7 uses? Thanks again for your help on this.

ansible does not embed jinja2, its just a dependency, so the
underlying version depends more on how you installed ansible and
pulled it in as a dependency.

This is probably caused by the attempt to normalize variable
management and error management in 1.8 which fixed/broke many things
like this. Facts were never meant to be templated and many errors were
being swallowed before, 1.8 started bringing them to the surface.