you indented with_items too much On Mon, Feb 23, 2015 at 4:42 PM, Chanaka Samarajeewa <[email protected]> wrote: > Hello, > > Can someone please let me know why I am getting this error message when > using with_items? Error message my task are as follows. > > ERROR: Syntax Error while loading YAML script, > /var/lib/awx/projects/_11813__automated_aws_cloud_watch_alarms/roles/cloudwatch_alarms/tasks/main.yml > Note: The error may actually appear before this position: line 30, column 1 > with_items: - { name: 'test-alarm', metric: 'CPUUtilization' } ^ This one > looks easy to fix. It seems that there is a value started with a quote, and > the YAML parser is expecting to see the line ended with the same kind of > quote. For instance: when: "ok" in result.stdout Could be written as: when: > '"ok" in result.stdout' or equivalently: when: "'ok' in result.stdout" > > > TASK: > -------------------------------------------- > > - name: singapore-ec2-cpu-utilization > local_action: > module: ec2_metric_alarm > state: present > region: ap-southeast-1 > name: "{{ item.name }}" > metric: "{{ item.metric }}" > namespace: "AWS/EC2" > statistic: Average > comparison: ">=" > threshold: 75.0 > period: 60 > evaluation_periods: 5 > unit: "Percent" > description: "test" > dimensions: {'InstanceId':'i-08a707c4'} > alarm_actions: > ["arn:aws:sns:ap-southeast-1:779200210943:chanakaalerts:35d082af-c259-4b8e-bc02-b2b516312afd"] > with_items: > - { name: 'test-alarm', metric: 'CPUUtilization' } > > > > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/4d8bf1aa-8752-4d18-964d-624a9db05bc7%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout.
-- Brian Coca -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8%3Dge8oPoaF9_aiSUbd75i%3DtCcAYvCD%3DiT5S9hT7s4xYCA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
