--- # tasks/CentOS/main.yml: CentOS specific set-up # This takes care of base prerequisites for CentOS - include_vars: "{{ ansible_distribution }}.yml" - name: Ensure the Sensu Core Yum repo is present copy: dest: /etc/yum.repos.d/sensu.repo content: | [sensu] name=sensu baseurl=https://sensu.global.ssl.fastly.net/yum/$releasever/$basearch/ gpgcheck=0 enabled=1 owner: root group: root mode: 0644 - name: Ensure that credential is supplied if installing Sensu Enterprise assert: that: - "se_user != ''" - "se_pass != ''" msg: Sensu enterprise credential must not be empty. Did you forget to set se_user and se_pass? when: se_enterprise - name: Ensure the Sensu Enterprise repo is present copy: dest: /etc/yum.repos.d/sensu-enterprise.repo content: | [sensu-enterprise] name=sensu-enterprise baseurl=http://{{ se_user }}:{{ se_pass }}@enterprise.sensuapp.com/yum/noarch/ gpgcheck=0 enabled=1 owner: root group: root mode: 0644 when: se_enterprise - name: Ensure the Sensu Enterprise Dashboard repo is present copy: dest: /etc/yum.repos.d/sensu-enterprise-dashboard.repo content: | [sensu-enterprise-dashboard] name=sensu-enterprise-dashboard baseurl=http://{{ se_user }}:{{ se_pass }}@enterprise.sensuapp.com/yum/\$basearch/ gpgcheck=0 enabled=1 owner: root group: root mode: 0644 when: se_enterprise - name: Ensure Sensu is installed yum: name={{ sensu_package }} state={{ sensu_pkg_state }} - name: Ensure Sensu Enterprise is installed yum: name={{ sensu_enterprise_package }} state={{ sensu_pkg_state }} when: se_enterprise