---
# tasks/Amazon/main.yml: CentOS specific set-up
# This takes care of base prerequisites for Amazon Linux AMI

  - include_vars: "{{ ansible_distribution }}.yml"

  - name: Set epel_version override when AmazonLinux AMIv2
    set_fact:
      epel_version: 7
    when: ansible_distribution_version == 'Candidate'

  - name: Ensure the Sensu Core Yum repo is present
    yum_repository:
      name: sensu
      description: The Sensu Core yum repository
      baseurl: "{{ sensu_yum_repo_url }}"
      gpgkey: "{{ sensu_yum_key_url }}"
      gpgcheck: yes
      enabled: yes

  - name: Ensure Sensu is installed
    yum:
      name: {{ sensu_package }}
      state: {{ sensu_pkg_state }}

---
# tasks/Amazon/main.yml: CentOS specific set-up
# This takes care of base prerequisites for Amazon Linux AMI

  - include_vars: "{{ ansible_distribution }}.yml"

  - name: Set epel_version override when AmazonLinux AMIv2
    set_fact:
      epel_version: 7
    when: ansible_distribution_version == 'Candidate'

  - name: Ensure the Sensu Core Yum repo is present
    yum_repository:
      name: sensu
      description: The Sensu Core yum repository
      baseurl: "{{ sensu_yum_repo_url }}"
      gpgkey: "{{ sensu_yum_key_url }}"
      gpgcheck: yes
      enabled: yes

  - name: Ensure Sensu is installed
    yum:
      name: "{{ sensu_package }}"
      state: "{{ sensu_pkg_state }}"

Add missing quotes around vars
Add missing quotes around vars
