Hello, I'm getting the following error when running my task. For some reason Ansible is complaining about >= characters, but it is ok with <= characters in the same file. I tried single quotes and double quotes around the characters but it causes other errors. Files and error message are as follows: Thank you for your help.
ERROR: Syntax Error while loading YAML script, /var/lib/awx/projects/_11813__automated_aws_cloud_watch_alarms/group_vars/ec2-alarms Note: The error may actually appear before this position: line 14, column 20 metric: NetworkIn comparison: >= ^ main.yml: ======= --- # ----------------------------------------------------- # AWS CloudWatch Alarms # ----------------------------------------------------- - include_vars: ec2-alarms.yml - debug: var=ec2-alarms - name: ec2-alarms with_items: ec2-alarms local_action: module: ec2_metric_alarm state: present region: "{{ item.region }}" name: "{{ item.region }}-{{ item.name }}-{{ item.metric }}-instanceId-{{ item.instanceId }}" metric: "{{ item.metric }}" namespace: "AWS/EC2" statistic: Average comparison: "{{ item.comparison }}" threshold: "{{ item.threshold }}" period: 300 evaluation_periods: 1 unit: "{{ item.unit }}" description: "" dimensions: {"InstanceId":"{{ item.instanceId }}"} alarm_actions: ["{{ item.alarm }}"] tags: alarm - name: ec2-ebs-alarms local_action: module: ec2_metric_alarm state: present region: "{{ item.region }}" name: "{{ item.region }}-{{ item.name }}-{{ item.metric }}-volumeId-{{ item.volumeId }}" metric: "{{ item.metric }}" namespace: "AWS/EBS" statistic: Average comparison: "{{ item.comparison }}" threshold: "{{ item.threshold }}" period: "{{ item.period }}" evaluation_periods: 1 unit: "{{ item.unit }}" description: "" dimensions: {"VolumeId":"{{ item.volumeId }}"} alarm_actions: ["{{ item.alarm }}"] with_items: - { name: 'chanakatest4', region: 'us-west-2', metric: 'VolumeReadOps', comparison: '>=', threshold: '1350', period: '3600', unit: 'None', volumeId: 'vol-69907266', alarm: 'arn:aws:sns:us-west-2:779200210943:sysalerts' } - { name: 'chanakatest5', region: 'us-west-2', metric: 'VolumeWriteOps', comparison: '>=', threshold: '1350', period: '3600', unit: 'None', volumeId: 'vol-69907266', alarm: 'arn:aws:sns:us-west-2:779200210943:sysalerts' } tags: alarm ec2-alarms yml =========== --- ec2-alarms: - name: chanakatest1 region: ap-southeast-1 metric: CPUUtilization comparison: <= threshold: 85.0 unit: Percent instanceId: i-10ca18dd alarm: arn:aws:sns:ap-southeast-1:779200210943:chanakaalerts - name: chanakatest2 region: ap-southeast-1 metric: NetworkIn comparison: >= threshold: 8000000000 unit: Bytes instanceId: i-10ca18dd alarm: arn:aws:sns:ap-southeast-1:779200210943:chanakaalerts - name: chanakatest3 region: ap-southeast-1 metric: NetworkOut comparison: >= threshold: 8000000000 unit: Bytes instanceId: i-10ca18dd alarm: arn:aws:sns:ap-southeast-1:779200210943:chanakaalerts -- 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/fe249d71-2387-4f79-9dba-254cb82e552d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.