Ver código fonte

Merge pull request #164 from jaredledvina/feature/enable-molecule-ansible-linting

Feature/enable molecule ansible linting
Jared 7 anos atrás
pai
commit
b9f65df620
55 arquivos alterados com 1238 adições e 1240 exclusões
  1. 1 3
      .yamllint
  2. 1 0
      CHANGELOG.md
  3. 54 54
      handlers/main.yml
  4. 18 17
      meta/main.yml
  5. 15 14
      mkdocs.yml
  6. 1 1
      molecule/amazonlinux/molecule.yml
  7. 1 1
      molecule/centos/molecule.yml
  8. 1 1
      molecule/debian/molecule.yml
  9. 1 1
      molecule/fedora/molecule.yml
  10. 1 1
      molecule/ubuntu/molecule.yml
  11. 10 10
      tasks/Amazon/dashboard.yml
  12. 17 17
      tasks/Amazon/main.yml
  13. 50 50
      tasks/Amazon/rabbit.yml
  14. 16 16
      tasks/Amazon/redis.yml
  15. 25 25
      tasks/CentOS/dashboard.yml
  16. 54 54
      tasks/CentOS/main.yml
  17. 50 50
      tasks/CentOS/rabbit.yml
  18. 16 16
      tasks/CentOS/redis.yml
  19. 10 10
      tasks/Debian/dashboard.yml
  20. 24 24
      tasks/Debian/main.yml
  21. 27 27
      tasks/Debian/rabbit.yml
  22. 13 13
      tasks/Debian/redis.yml
  23. 24 27
      tasks/Fedora/rabbit.yml
  24. 10 10
      tasks/Fedora/redis.yml
  25. 61 61
      tasks/FreeBSD/dashboard.yml
  26. 34 34
      tasks/FreeBSD/main.yml
  27. 5 5
      tasks/FreeBSD/rabbit.yml
  28. 12 12
      tasks/FreeBSD/redis.yml
  29. 61 61
      tasks/OpenBSD/dashboard.yml
  30. 54 54
      tasks/OpenBSD/main.yml
  31. 5 5
      tasks/OpenBSD/rabbit.yml
  32. 12 12
      tasks/OpenBSD/redis.yml
  33. 12 12
      tasks/SmartOS/client.yml
  34. 67 67
      tasks/SmartOS/dashboard.yml
  35. 19 19
      tasks/SmartOS/main.yml
  36. 7 7
      tasks/SmartOS/rabbit.yml
  37. 3 3
      tasks/SmartOS/redis.yml
  38. 18 18
      tasks/SmartOS/server.yml
  39. 10 10
      tasks/Ubuntu/dashboard.yml
  40. 20 20
      tasks/Ubuntu/main.yml
  41. 27 27
      tasks/Ubuntu/rabbit.yml
  42. 23 23
      tasks/Ubuntu/redis.yml
  43. 17 17
      tasks/client.yml
  44. 48 48
      tasks/common.yml
  45. 6 6
      tasks/dashboard.yml
  46. 45 45
      tasks/main.yml
  47. 90 90
      tasks/plugins.yml
  48. 43 43
      tasks/rabbit.yml
  49. 7 7
      tasks/redis.yml
  50. 16 16
      tasks/server.yml
  51. 24 24
      tasks/ssl.yml
  52. 48 48
      tasks/ssl_generate.yml
  53. 2 2
      vars/Amazon.yml
  54. 1 1
      vars/CentOS.yml
  55. 1 1
      vars/Fedora.yml

+ 1 - 3
.yamllint

@@ -8,6 +8,4 @@ rules:
     max-spaces-inside: 1
     level: error
   line-length: disable
-  # NOTE(retr0h): Templates no longer fail this lint rule.
-  #               Uncomment if running old Molecule templates.
-  # truthy: disable
+  truthy: disable

+ 1 - 0
CHANGELOG.md

@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
 - Amazon Linux now installs a supported version of Erlang and RabbitMQ from Bintray (@jaredledvina)
 - Fixup the CentOS RabbitMQ install w/ full GPG signing verification (@jaredledvina)
 - Various syntax cleanups and testing documentation updates (@jaredledvina)
+- Enable `yamllint` checking and fixup all files to pass checks (@jaredledvina)
 
 ## [2.4.0] - 2018-05-06
 ### Fixed:

+ 54 - 54
handlers/main.yml

@@ -1,69 +1,69 @@
 ---
 
-  - name: restart rabbitmq service
-    service:
-      name: "{{ rabbitmq_service_name }}"
-      state: restarted
+- name: restart rabbitmq service
+  service:
+    name: "{{ rabbitmq_service_name }}"
+    state: restarted
 
-  - name: restart redis service
-    service:
-      name: "{{ redis_service_name }}"
-      pattern: /usr/bin/redis-server
-      state: restarted
+- name: restart redis service
+  service:
+    name: "{{ redis_service_name }}"
+    pattern: /usr/bin/redis-server
+    state: restarted
 
-  - name: restart uchiwa service
-    service:
-      name: "{{ uchiwa_service_name }}"
-      state: restarted
+- name: restart uchiwa service
+  service:
+    name: "{{ uchiwa_service_name }}"
+    state: restarted
 
-  - name: restart sensu-server service
-    service:
-      name: "{{ sensu_server_service_name }}"
-      state: restarted
-    when: sensu_master and not se_enterprise
+- name: restart sensu-server service
+  service:
+    name: "{{ sensu_server_service_name }}"
+    state: restarted
+  when: sensu_master and not se_enterprise
 
-  - name: restart sensu-api service
-    service:
-      name: "{{ sensu_api_service_name }}"
-      state: restarted
-    when: sensu_master and not se_enterprise
+- name: restart sensu-api service
+  service:
+    name: "{{ sensu_api_service_name }}"
+    state: restarted
+  when: sensu_master and not se_enterprise
 
-  - name: restart sensu-client service
-    service:
-      name: "{{ sensu_client_service_name }}"
-      state: restarted
+- name: restart sensu-client service
+  service:
+    name: "{{ sensu_client_service_name }}"
+    state: restarted
 
-  - name: restart sensu-enterprise service
-    service:
-      name: "{{ sensu_enterprise_service_name }}"
-      state: restarted
-    when: se_enterprise and sensu_master
+- name: restart sensu-enterprise service
+  service:
+    name: "{{ sensu_enterprise_service_name }}"
+    state: restarted
+  when: se_enterprise and sensu_master
 
-  - name: restart sensu-enterprise-dashboard service
-    service:
-      name: "{{ sensu_enterprise_dashboard_service_name }}"
-      state: restarted
-    when: se_enterprise and sensu_master
+- name: restart sensu-enterprise-dashboard service
+  service:
+    name: "{{ sensu_enterprise_dashboard_service_name }}"
+    state: restarted
+  when: se_enterprise and sensu_master
 
-  # Joyent SmartOS specific handlers
-  - name: import sensu-server service
-    command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/sensu-server.xml
+# Joyent SmartOS specific handlers
+- name: import sensu-server service
+  command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/sensu-server.xml
 
-  - name: import sensu-api service
-    command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/sensu-api.xml
+- name: import sensu-api service
+  command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/sensu-api.xml
 
-  - name: import sensu-client service
-    command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/sensu-client.xml
+- name: import sensu-client service
+  command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/sensu-client.xml
 
-  - name: import uchiwa service
-    command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/uchiwa.xml
+- name: import uchiwa service
+  command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/uchiwa.xml
 
-  - name: Build and deploy Uchiwa
-    shell: npm install --production
-    args:
-      chdir: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
-    become: true
-    become_user: "{{ sensu_user_name }}"
+- name: Build and deploy Uchiwa
+  shell: npm install --production
+  args:
+    chdir: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
+  become: true
+  become_user: "{{ sensu_user_name }}"
 
-  - name: Update pkgng database
-    command: /usr/sbin/pkg update
+- name: Update pkgng database
+  command: /usr/sbin/pkg update

+ 18 - 17
meta/main.yml

@@ -1,26 +1,27 @@
+---
 galaxy_info:
   author: Calum MacRae
   description: Deploy a full Sensu monitoring stack; including redis, RabbitMQ & the Uchiwa dashboard
   license: MIT
   min_ansible_version: 2.3
   platforms:
-  - name: EL
-    versions:
-      - 6
-      - 7
-  - name: Ubuntu
-    versions:
-      - trusty
-      - vivid
-  - name: Debian
-    versions:
-      - jessie
-      - stretch
-  - name: Fedora
-    versions:
-      - 26
-      - 27
-      - 28
+    - name: EL
+      versions:
+        - 6
+        - 7
+    - name: Ubuntu
+      versions:
+        - trusty
+        - vivid
+    - name: Debian
+      versions:
+        - jessie
+        - stretch
+    - name: Fedora
+      versions:
+        - 26
+        - 27
+        - 28
 
   galaxy_tags:
     - cloud

+ 15 - 14
mkdocs.yml

@@ -1,3 +1,4 @@
+---
 site_name: Ansible Sensu
 site_url: https://galaxy.ansible.com/sensu/sensu
 repo_url: https://github.com/sensu/sensu-ansible
@@ -8,19 +9,19 @@ theme: flatly
 pages:
   - Home: index.md
   - Usage:
-    - Role variables: role_variables.md
-    - Example infrastructure layout: example_infra.md
-    - Deploy the stack to a single node: single_master.md
-    - A differing master environment: differing_master_environment.md
-    - Custom client configuration: custom_client_config.md
-    - Deployment of handlers/filters/mutators: deploy_plugins.md
-    - Remote plugin deployment: remote_plugins.md
-    - Sensitive information in version control: sensitive_info.md
-    - Integration with other roles/managment methods: integration.md
-    - Testing: testing.md
+      - Role variables: role_variables.md
+      - Example infrastructure layout: example_infra.md
+      - Deploy the stack to a single node: single_master.md
+      - A differing master environment: differing_master_environment.md
+      - Custom client configuration: custom_client_config.md
+      - Deployment of handlers/filters/mutators: deploy_plugins.md
+      - Remote plugin deployment: remote_plugins.md
+      - Sensitive information in version control: sensitive_info.md
+      - Integration with other roles/managment methods: integration.md
+      - Testing: testing.md
   - Conventions:
-    - Dynamic data store: dynamic_data.md
-    - Dynamic check deployment: dynamic_checks.md
+      - Dynamic data store: dynamic_data.md
+      - Dynamic check deployment: dynamic_checks.md
   - About:
-    - A few words from the author: afewwords.md
-    - License: license.md
+      - A few words from the author: afewwords.md
+      - License: license.md

+ 1 - 1
molecule/amazonlinux/molecule.yml

@@ -7,7 +7,7 @@ driver:
   name: docker
 lint:
   name: yamllint
-  enabled: False
+  enabled: True
 platforms:
   - name: amazonlinux-1
     image: dokken/amazonlinux

+ 1 - 1
molecule/centos/molecule.yml

@@ -7,7 +7,7 @@ driver:
   name: docker
 lint:
   name: yamllint
-  enabled: False
+  enabled: True
 platforms:
   - name: centos-6
     image: dokken/centos-6

+ 1 - 1
molecule/debian/molecule.yml

@@ -7,7 +7,7 @@ driver:
   name: docker
 lint:
   name: yamllint
-  enabled: False
+  enabled: True
 platforms:
   - name: debian-8
     image: dokken/debian-8

+ 1 - 1
molecule/fedora/molecule.yml

@@ -7,7 +7,7 @@ driver:
   name: docker
 lint:
   name: yamllint
-  enabled: False
+  enabled: True
 platforms:
   - name: fedora-26
     image: dokken/fedora-26

+ 1 - 1
molecule/ubuntu/molecule.yml

@@ -7,7 +7,7 @@ driver:
   name: docker
 lint:
   name: yamllint
-  enabled: False
+  enabled: True
 platforms:
   - name: ubuntu-14.04
     image: dokken/ubuntu-14.04

+ 10 - 10
tasks/Amazon/dashboard.yml

@@ -2,15 +2,15 @@
 # tasks/Amazon/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to CentOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure Uchiwa is installed
-    yum:
-      name: uchiwa
-      state: present
+- name: Ensure Uchiwa is installed
+  yum:
+    name: uchiwa
+    state: present
 
-  - name: Deploy Uchiwa config
-    template:
-      src: uchiwa_config.json.j2
-      dest: "{{ sensu_config_path }}/uchiwa.json"
-    notify: restart uchiwa service
+- name: Deploy Uchiwa config
+  template:
+    src: uchiwa_config.json.j2
+    dest: "{{ sensu_config_path }}/uchiwa.json"
+  notify: restart uchiwa service

+ 17 - 17
tasks/Amazon/main.yml

@@ -2,23 +2,23 @@
 # tasks/Amazon/main.yml: CentOS specific set-up
 # This takes care of base prerequisites for Amazon Linux AMI
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Set epel_version override when AmazonLinux AMIv2
-    set_fact:
-      epel_version: 7
-    when: ansible_distribution_version == 'Candidate'
+- 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 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 }}"
+- name: Ensure Sensu is installed
+  yum:
+    name: "{{ sensu_package }}"
+    state: "{{ sensu_pkg_state }}"

+ 50 - 50
tasks/Amazon/rabbit.yml

@@ -2,59 +2,59 @@
 # tasks/Amazon/rabbit.yml: Deploy RabbitMQ
 # Specific to Amazon Linux
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Configure RabbitMQ/RabbitMQ-erlang GPG keys in the RPM keyring
-    rpm_key:
-      key: "{{ item }}"
-      state: present
-    with_items:
-      - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-    register: sensu_rabbitmq_import_key
+- name: Configure RabbitMQ/RabbitMQ-erlang GPG keys in the RPM keyring
+  rpm_key:
+    key: "{{ item }}"
+    state: present
+  with_items:
+    - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+  register: sensu_rabbitmq_import_key
 
-  - name: Add RabbitMQ's repo
-    yum_repository:
-      name: rabbitmq
-      description: rabbitmq
-      baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/{{ epel_version }}"
-      gpgcheck: yes
-      gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      repo_gpgcheck: no
+- name: Add RabbitMQ's repo
+  yum_repository:
+    name: rabbitmq
+    description: rabbitmq
+    baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/{{ epel_version }}"
+    gpgcheck: yes
+    gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    repo_gpgcheck: no
 
-  - name: Add RabbitMQ's Erlang repo
-    yum_repository:
-      name: rabbitmq-erlang
-      description: rabbitmq-erlang
-      baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/{{ epel_version }}"
-      gpgcheck: yes
-      gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      repo_gpgcheck: no
+- name: Add RabbitMQ's Erlang repo
+  yum_repository:
+    name: rabbitmq-erlang
+    description: rabbitmq-erlang
+    baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/{{ epel_version }}"
+    gpgcheck: yes
+    gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    repo_gpgcheck: no
 
-  # HACK: https://github.com/ansible/ansible/issues/20711#issuecomment-306260869
-  # Can be removed once we're running w/ a version of Ansible that has https://github.com/ansible/ansible/pull/35989
-  - name: Make yum cache to import GPG keys
-    command: "yum -q makecache -y --disablerepo='*' --enablerepo='{{ item }}'"
-    args:
-      warn: false
-    when: sensu_rabbitmq_import_key.changed
-    with_items:
-      - rabbitmq
-      - rabbitmq-erlang
+# HACK: https://github.com/ansible/ansible/issues/20711#issuecomment-306260869
+# Can be removed once we're running w/ a version of Ansible that has https://github.com/ansible/ansible/pull/35989
+- name: Make yum cache to import GPG keys
+  command: "yum -q makecache -y --disablerepo='*' --enablerepo='{{ item }}'"
+  args:
+    warn: false
+  when: sensu_rabbitmq_import_key.changed
+  with_items:
+    - rabbitmq
+    - rabbitmq-erlang
 
-  # Hard dependency for rabbitmq-server, however, typically comes from EPEL, so
-  # we simply install it here, as we purposely disable epel when installing rabbitmq
-  # causing dependency issues during installs
-  - name: Ensure socat is installed
-    yum:
-      name: socat
-      state: present
+# Hard dependency for rabbitmq-server, however, typically comes from EPEL, so
+# we simply install it here, as we purposely disable epel when installing rabbitmq
+# causing dependency issues during installs
+- name: Ensure socat is installed
+  yum:
+    name: socat
+    state: present
 
-  - name: Ensure Erlang & RabbitMQ are installed
-    yum:
-      name:
-        - erlang
-        - rabbitmq-server
-      state: present
-      enablerepo: rabbitmq,rabbitmq-erlang
-      disablerepo: '*'
+- name: Ensure Erlang & RabbitMQ are installed
+  yum:
+    name:
+      - erlang
+      - rabbitmq-server
+    state: present
+    enablerepo: rabbitmq,rabbitmq-erlang
+    disablerepo: '*'

+ 16 - 16
tasks/Amazon/redis.yml

@@ -2,22 +2,22 @@
 # tasks/Amazon/redis.yml: Deploy redis
 # Specific to Amazon Linux AMI
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Install EPEL repo
-    yum:
-      name: "{{ epel_repo_rpm }}"
-      state: present
-    when: enable_epel_repo
+- name: Install EPEL repo
+  yum:
+    name: "{{ epel_repo_rpm }}"
+    state: present
+  when: enable_epel_repo
 
-  - name: Ensure redis is installed
-    yum:
-      name: "{{ redis_pkg_name }}"
-      state: "{{ redis_pkg_state }}"
-      enablerepo: epel
+- name: Ensure redis is installed
+  yum:
+    name: "{{ redis_pkg_name }}"
+    state: "{{ redis_pkg_state }}"
+    enablerepo: epel
 
-  - name: Ensure redis binds to accessible IP
-    lineinfile:
-      dest: /etc/redis.conf
-      regexp: '^bind'
-      line: 'bind 0.0.0.0'
+- name: Ensure redis binds to accessible IP
+  lineinfile:
+    dest: /etc/redis.conf
+    regexp: '^bind'
+    line: 'bind 0.0.0.0'

+ 25 - 25
tasks/CentOS/dashboard.yml

@@ -2,33 +2,33 @@
 # tasks/CentOS/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to CentOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure Uchiwa is installed
-    package:
-      name: uchiwa
-      state: present
-    when: not se_enterprise
+- name: Ensure Uchiwa is installed
+  package:
+    name: uchiwa
+    state: present
+  when: not se_enterprise
 
-  - name: Ensure Sensu Enterprise Dashboard is installed
-    package:
-      name: "{{ sensu_enterprise_dashboard_package }}"
-      state: present
-    when: se_enterprise
+- name: Ensure Sensu Enterprise Dashboard is installed
+  package:
+    name: "{{ sensu_enterprise_dashboard_package }}"
+    state: present
+  when: se_enterprise
 
-  - name: Deploy Uchiwa config
-    template:
-      src: uchiwa_config.json.j2
-      dest: "{{ sensu_config_path }}/uchiwa.json"
-    when: not se_enterprise
-    notify:
-      - restart uchiwa service
+- name: Deploy Uchiwa config
+  template:
+    src: uchiwa_config.json.j2
+    dest: "{{ sensu_config_path }}/uchiwa.json"
+  when: not se_enterprise
+  notify:
+    - restart uchiwa service
 
 
-  - name: Deploy Sensu Enterprise Dashboard
-    template:
-      src: sensu_enterprise_dashboard_config.json.j2
-      dest: "{{ sensu_config_path}}/dashboard.json"
-    when: se_enterprise
-    notify:
-      - restart sensu-enterprise-dashboard service
+- name: Deploy Sensu Enterprise Dashboard
+  template:
+    src: sensu_enterprise_dashboard_config.json.j2
+    dest: "{{ sensu_config_path}}/dashboard.json"
+  when: se_enterprise
+  notify:
+    - restart sensu-enterprise-dashboard service

+ 54 - 54
tasks/CentOS/main.yml

@@ -2,63 +2,63 @@
 # tasks/CentOS/main.yml: CentOS specific set-up
 # This takes care of base prerequisites for CentOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - 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: "{{ (
-        (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and
-        ansible_distribution_major_version == '5'
-        ) | ternary('no', 'yes') }}"
-      enabled: yes
+- 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: "{{ (
+      (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and
+      ansible_distribution_major_version == '5'
+      ) | ternary('no', 'yes') }}"
+    enabled: yes
 
-  - 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 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 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 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
-    package:
-      name: "{{ sensu_package }}"
-      state: "{{ sensu_pkg_state }}"
+- name: Ensure Sensu is installed
+  package:
+    name: "{{ sensu_package }}"
+    state: "{{ sensu_pkg_state }}"
 
-  - name: Ensure Sensu Enterprise is installed
-    package:
-      name: "{{ sensu_enterprise_package }}"
-      state: "{{ sensu_pkg_state }}"
-    when: se_enterprise
+- name: Ensure Sensu Enterprise is installed
+  package:
+    name: "{{ sensu_enterprise_package }}"
+    state: "{{ sensu_pkg_state }}"
+  when: se_enterprise

+ 50 - 50
tasks/CentOS/rabbit.yml

@@ -2,59 +2,59 @@
 # tasks/CentOS/rabbit.yml: Deploy RabbitMQ
 # Specific to CentOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Configure RabbitMQ/RabbitMQ-erlang GPG keys in the RPM keyring
-    rpm_key:
-      key: "{{ item }}"
-      state: present
-    with_items:
-      - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-    register: sensu_rabbitmq_import_key
+- name: Configure RabbitMQ/RabbitMQ-erlang GPG keys in the RPM keyring
+  rpm_key:
+    key: "{{ item }}"
+    state: present
+  with_items:
+    - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    - https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+  register: sensu_rabbitmq_import_key
 
-  - name: Add RabbitMQ's repo
-    yum_repository:
-      name: rabbitmq
-      description: rabbitmq
-      baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/{{ansible_distribution_major_version}}"
-      gpgcheck: yes
-      gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      repo_gpgcheck: no
+- name: Add RabbitMQ's repo
+  yum_repository:
+    name: rabbitmq
+    description: rabbitmq
+    baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/{{ansible_distribution_major_version}}"
+    gpgcheck: yes
+    gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    repo_gpgcheck: no
 
-  - name: Add RabbitMQ's Erlang repo
-    yum_repository:
-      name: rabbitmq-erlang
-      description: rabbitmq-erlang
-      baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/{{ansible_distribution_major_version}}"
-      gpgcheck: yes
-      gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      repo_gpgcheck: no
+- name: Add RabbitMQ's Erlang repo
+  yum_repository:
+    name: rabbitmq-erlang
+    description: rabbitmq-erlang
+    baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/{{ansible_distribution_major_version}}"
+    gpgcheck: yes
+    gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    repo_gpgcheck: no
 
-  # HACK: https://github.com/ansible/ansible/issues/20711#issuecomment-306260869
-  # Can be removed once we're running w/ a version of Ansible that has https://github.com/ansible/ansible/pull/35989
-  - name: Make yum cache to import GPG keys
-    command: "yum -q makecache -y --disablerepo='*' --enablerepo='{{ item }}'"
-    args:
-      warn: false
-    when: sensu_rabbitmq_import_key.changed
-    with_items:
-      - rabbitmq
-      - rabbitmq-erlang
+# HACK: https://github.com/ansible/ansible/issues/20711#issuecomment-306260869
+# Can be removed once we're running w/ a version of Ansible that has https://github.com/ansible/ansible/pull/35989
+- name: Make yum cache to import GPG keys
+  command: "yum -q makecache -y --disablerepo='*' --enablerepo='{{ item }}'"
+  args:
+    warn: false
+  when: sensu_rabbitmq_import_key.changed
+  with_items:
+    - rabbitmq
+    - rabbitmq-erlang
 
-  # Hard dependency for rabbitmq-server, however, typically comes from EPEL, so
-  # we simply install it here, as we purposely disable epel when installing rabbitmq
-  # causing dependency issues during installs
-  - name: Ensure socat is installed
-    yum:
-      name: socat
-      state: present
+# Hard dependency for rabbitmq-server, however, typically comes from EPEL, so
+# we simply install it here, as we purposely disable epel when installing rabbitmq
+# causing dependency issues during installs
+- name: Ensure socat is installed
+  yum:
+    name: socat
+    state: present
 
-  - name: Ensure Erlang & RabbitMQ are installed
-    yum:
-      name:
-        - erlang
-        - rabbitmq-server
-      state: present
-      enablerepo: rabbitmq,rabbitmq-erlang
-      disablerepo: epel
+- name: Ensure Erlang & RabbitMQ are installed
+  yum:
+    name:
+      - erlang
+      - rabbitmq-server
+    state: present
+    enablerepo: rabbitmq,rabbitmq-erlang
+    disablerepo: epel

+ 16 - 16
tasks/CentOS/redis.yml

@@ -2,22 +2,22 @@
 # tasks/CentOS/redis.yml: Deploy redis
 # Specific to CentOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Install EPEL repo
-    yum:
-      name: epel-release
-      state: present
-    when: enable_epel_repo
+- name: Install EPEL repo
+  yum:
+    name: epel-release
+    state: present
+  when: enable_epel_repo
 
-  - name: Ensure redis is installed
-    yum:
-      name: "{{ redis_pkg_name }}"
-      state: "{{ redis_pkg_state }}"
-      enablerepo: "{{ centos_repository }}"
+- name: Ensure redis is installed
+  yum:
+    name: "{{ redis_pkg_name }}"
+    state: "{{ redis_pkg_state }}"
+    enablerepo: "{{ centos_repository }}"
 
-  - name: Ensure redis binds to accessible IP
-    lineinfile:
-      dest: /etc/redis.conf
-      regexp: '^bind'
-      line: 'bind 0.0.0.0'
+- name: Ensure redis binds to accessible IP
+  lineinfile:
+    dest: /etc/redis.conf
+    regexp: '^bind'
+    line: 'bind 0.0.0.0'

+ 10 - 10
tasks/Debian/dashboard.yml

@@ -2,15 +2,15 @@
 # tasks/Debian/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to Debian
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Install uchiwa
-    apt:
-      name: uchiwa
-      state: present
+- name: Install uchiwa
+  apt:
+    name: uchiwa
+    state: present
 
-  - name: Deploy Uchiwa config
-    template:
-      src: uchiwa_config.json.j2
-      dest: "{{ sensu_config_path }}/uchiwa.json"
-    notify: restart uchiwa service
+- name: Deploy Uchiwa config
+  template:
+    src: uchiwa_config.json.j2
+    dest: "{{ sensu_config_path }}/uchiwa.json"
+  notify: restart uchiwa service

+ 24 - 24
tasks/Debian/main.yml

@@ -2,32 +2,32 @@
 # tasks/Debian/main.yml: Debian specific set-up
 # This takes care of base prerequisites for Debian
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure apt-transport-https is installed
-    apt:
-      name: apt-transport-https
-      state: present
-      cache_valid_time: 3600
-      update_cache: true
+- name: Ensure apt-transport-https is installed
+  apt:
+    name: apt-transport-https
+    state: present
+    cache_valid_time: 3600
+    update_cache: true
 
-  - name: Ensure that gnupg is installed for apt_key
-    apt:
-      name: gnupg
-      state: present
+- name: Ensure that gnupg is installed for apt_key
+  apt:
+    name: gnupg
+    state: present
 
-  - name: Ensure the Sensu APT repo GPG key is present
-    apt_key:
-      url: "{{ sensu_apt_key_url }}"
-      state: present
+- name: Ensure the Sensu APT repo GPG key is present
+  apt_key:
+    url: "{{ sensu_apt_key_url }}"
+    state: present
 
-  - name: Ensure the Sensu Core APT repo is present
-    apt_repository:
-      repo: "{{ sensu_apt_repo_url }}"
-      state: present
-      update_cache: true
+- name: Ensure the Sensu Core APT repo is present
+  apt_repository:
+    repo: "{{ sensu_apt_repo_url }}"
+    state: present
+    update_cache: true
 
-  - name: Ensure Sensu is installed
-    apt:
-      name: "{{ sensu_package }}"
-      state: "{{ sensu_pkg_state }}"
+- name: Ensure Sensu is installed
+  apt:
+    name: "{{ sensu_package }}"
+    state: "{{ sensu_pkg_state }}"

+ 27 - 27
tasks/Debian/rabbit.yml

@@ -2,35 +2,35 @@
 # tasks/Debian/rabbit.yml: Deploy RabbitMQ
 # Specific to Debian
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure the RabbitMQ APT repo GPG key is present
-    apt_key:
-      url: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      state: present
+- name: Ensure the RabbitMQ APT repo GPG key is present
+  apt_key:
+    url: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    state: present
 
-  - name: Ensure the RabbitMQ APT repo is present
-    apt_repository:
-      repo: "deb https://dl.bintray.com/rabbitmq/debian {{ ansible_distribution_release }} main"
-      filename: rabbitmq
-      state: present
-      update_cache: true
+- name: Ensure the RabbitMQ APT repo is present
+  apt_repository:
+    repo: "deb https://dl.bintray.com/rabbitmq/debian {{ ansible_distribution_release }} main"
+    filename: rabbitmq
+    state: present
+    update_cache: true
 
-  - name: Ensure the Erlang APT repo GPG key is present
-    apt_key:
-      url: https://packages.erlang-solutions.com/debian/erlang_solutions.asc
-      state: present
+- name: Ensure the Erlang APT repo GPG key is present
+  apt_key:
+    url: https://packages.erlang-solutions.com/debian/erlang_solutions.asc
+    state: present
 
-  - name: Ensure the Erlang APT repo is present
-    apt_repository:
-      repo: "deb https://packages.erlang-solutions.com/debian {{ ansible_distribution_release }} contrib"
-      filename: erlang
-      state: present
-      update_cache: true
+- name: Ensure the Erlang APT repo is present
+  apt_repository:
+    repo: "deb https://packages.erlang-solutions.com/debian {{ ansible_distribution_release }} contrib"
+    filename: erlang
+    state: present
+    update_cache: true
 
-  - name: Ensure RabbitMQ is installed
-    apt:
-      name: rabbitmq-server
-      state: "{{ rabbitmq_pkg_state }}"
-      cache_valid_time: 600
-      update_cache: true
+- name: Ensure RabbitMQ is installed
+  apt:
+    name: rabbitmq-server
+    state: "{{ rabbitmq_pkg_state }}"
+    cache_valid_time: 600
+    update_cache: true

+ 13 - 13
tasks/Debian/redis.yml

@@ -2,19 +2,19 @@
 # tasks/Debian/redis.yml: Deploy redis
 # Specific to Debian
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure redis is installed
-    apt:
-      name: "{{ redis_pkg_name }}"
-      state: "{{ redis_pkg_state }}"
-      update_cache: true
+- name: Ensure redis is installed
+  apt:
+    name: "{{ redis_pkg_name }}"
+    state: "{{ redis_pkg_state }}"
+    update_cache: true
 
-  - name: Ensure redis binds to accessible IP
-    lineinfile:
-      dest: /etc/redis/redis.conf
-      regexp: '^bind'
-      line: 'bind 0.0.0.0'
-    notify: restart redis service
+- name: Ensure redis binds to accessible IP
+  lineinfile:
+    dest: /etc/redis/redis.conf
+    regexp: '^bind'
+    line: 'bind 0.0.0.0'
+  notify: restart redis service
 
-  - meta: flush_handlers
+- meta: flush_handlers

+ 24 - 27
tasks/Fedora/rabbit.yml

@@ -2,33 +2,30 @@
 # tasks/Fedora/rabbit.yml: Deploy RabbitMQ
 # Specific to Fedora
 
-  - include_vars: "{{ ansible_distribution }}.yml"
-
-  - name: Add RabbitMQ's repo
-    yum_repository:
-      name: rabbitmq
-      description: rabbitmq
-      baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/7"
-      gpgcheck: yes
-      gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      repo_gpgcheck: no
-
-  - name: Add RabbitMQ's Erlang repo
-    yum_repository:
-      name: rabbitmq-erlang
-      description: rabbitmq-erlang
-      baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/7"
-      gpgcheck: yes
-      gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      repo_gpgcheck: no
-
-  - name: Ensure Erlang & RabbitMQ are installed
-    dnf:
-      name:
-        - erlang
-        - rabbitmq-server
-      state: present
-      enablerepo: rabbitmq,rabbitmq-erlang
+- include_vars: "{{ ansible_distribution }}.yml"
 
+- name: Add RabbitMQ's repo
+  yum_repository:
+    name: rabbitmq
+    description: rabbitmq
+    baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/7"
+    gpgcheck: yes
+    gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    repo_gpgcheck: no
 
+- name: Add RabbitMQ's Erlang repo
+  yum_repository:
+    name: rabbitmq-erlang
+    description: rabbitmq-erlang
+    baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/7"
+    gpgcheck: yes
+    gpgkey: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    repo_gpgcheck: no
 
+- name: Ensure Erlang & RabbitMQ are installed
+  dnf:
+    name:
+      - erlang
+      - rabbitmq-server
+    state: present
+    enablerepo: rabbitmq,rabbitmq-erlang

+ 10 - 10
tasks/Fedora/redis.yml

@@ -2,15 +2,15 @@
 # tasks/Fedora/redis.yml: Deploy redis
 # Specific to Fedora
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure redis is installed
-    dnf:
-      name: "{{ redis_pkg_name }}"
-      state: "{{ redis_pkg_state }}"
+- name: Ensure redis is installed
+  dnf:
+    name: "{{ redis_pkg_name }}"
+    state: "{{ redis_pkg_state }}"
 
-  - name: Ensure redis binds to accessible IP
-    lineinfile:
-      dest: /etc/redis.conf
-      regexp: '^bind'
-      line: 'bind 0.0.0.0'
+- name: Ensure redis binds to accessible IP
+  lineinfile:
+    dest: /etc/redis.conf
+    regexp: '^bind'
+    line: 'bind 0.0.0.0'

+ 61 - 61
tasks/FreeBSD/dashboard.yml

@@ -2,73 +2,73 @@
 # tasks/FreeBSD/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to FreeBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure Uchiwa (dashboard) dependencies are installed
-    pkgng:
-      name: "{{ item }}"
-      state: present
-    with_items:
-      - go
-      - git
-      - npm
+- name: Ensure Uchiwa (dashboard) dependencies are installed
+  pkgng:
+    name: "{{ item }}"
+    state: present
+  with_items:
+    - go
+    - git
+    - npm
 
-  - name: Ensure Uchiwa directory exists
-    file:
-      dest: "{{ uchiwa_path }}"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      recurse: true
+- name: Ensure Uchiwa directory exists
+  file:
+    dest: "{{ uchiwa_path }}"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    recurse: true
 
-  - name: Ensure Uchiwa Go/config directory exists
-    file:
-      dest: "{{ uchiwa_path }}/{{ item }}"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      recurse: true
-    with_items:
-      - etc
-      - go
+- name: Ensure Uchiwa Go/config directory exists
+  file:
+    dest: "{{ uchiwa_path }}/{{ item }}"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    recurse: true
+  with_items:
+    - etc
+    - go
 
-  - name: Ensure Uchiwa GOPATH exists
-    file:
-      dest: "{{ uchiwa_path }}/go/{{ item }}"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      state: directory
-      recurse: true
-    with_items:
-      - bin
-      - pkg
-      - src
+- name: Ensure Uchiwa GOPATH exists
+  file:
+    dest: "{{ uchiwa_path }}/go/{{ item }}"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    state: directory
+    recurse: true
+  with_items:
+    - bin
+    - pkg
+    - src
 
-  - name: Fetch Uchiwa from GitHub
-    command: go get github.com/sensu/uchiwa
-    environment:
-      GOPATH: "{{ uchiwa_path }}/go"
-    args:
-      creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
-    notify: Build and deploy Uchiwa
-    become: true
-    become_user: "{{ sensu_user_name }}"
+- name: Fetch Uchiwa from GitHub
+  command: go get github.com/sensu/uchiwa
+  environment:
+    GOPATH: "{{ uchiwa_path }}/go"
+  args:
+    creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
+  notify: Build and deploy Uchiwa
+  become: true
+  become_user: "{{ sensu_user_name }}"
 
-  - meta: flush_handlers
+- meta: flush_handlers
 
-  - name: Deploy Uchiwa config
-    template:
-      src: uchiwa_config.json.j2
-      dest: "{{ uchiwa_path }}/etc/config.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    notify: restart uchiwa service
+- name: Deploy Uchiwa config
+  template:
+    src: uchiwa_config.json.j2
+    dest: "{{ uchiwa_path }}/etc/config.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  notify: restart uchiwa service
 
-  - name: Deploy Uchiwa service file
-    template:
-      src: uchiwa_freebsd.j2
-      dest: "/usr/local/etc/rc.d/uchiwa"
-      mode: "0755"
+- name: Deploy Uchiwa service file
+  template:
+    src: uchiwa_freebsd.j2
+    dest: "/usr/local/etc/rc.d/uchiwa"
+    mode: "0755"
 
-  - name: Ensure Uchiwa server service is running
-    service: name=uchiwa state=started enabled=yes
+- name: Ensure Uchiwa server service is running
+  service: name=uchiwa state=started enabled=yes

+ 34 - 34
tasks/FreeBSD/main.yml

@@ -2,43 +2,43 @@
 # tasks/FreeBSD/main.yml: FreeBSD specific set-up
 # This takes care of base prerequisites for FreeBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure the Sensu group is present
-    group:
-      name: {{ sensu_group_name }}
-      state: present
+- name: Ensure the Sensu group is present
+  group:
+    name: {{ sensu_group_name }}
+    state: present
 
-  - name: Ensure the Sensu user is present
-    user:
-      name: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      shell: /bin/false
-      home: "{{ sensu_config_path }}"
-      createhome: true
-      state: present
+- name: Ensure the Sensu user is present
+  user:
+    name: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    shell: /bin/false
+    home: "{{ sensu_config_path }}"
+    createhome: true
+    state: present
 
-  - name: Ensure pkgng custom repo config directory exists
-    file:
-      path: /usr/local/etc/pkg/repos/
-      state: directory
+- name: Ensure pkgng custom repo config directory exists
+  file:
+    path: /usr/local/etc/pkg/repos/
+    state: directory
 
-  - name: Ensure Sensu repo is configured
-    template:
-      src: sensu-freebsd-repo.conf.j2
-      dest: /usr/local/etc/pkg/repos/sensu.conf
-    notify:
-      - Update pkgng database
+- name: Ensure Sensu repo is configured
+  template:
+    src: sensu-freebsd-repo.conf.j2
+    dest: /usr/local/etc/pkg/repos/sensu.conf
+  notify:
+    - Update pkgng database
 
-  - name: Ensure prerequisite packages are installed
-    pkgng:
-      name: "{{ item }}"
-      state: present
-    with_items:
-      - bash
-      - ca_root_nss
+- name: Ensure prerequisite packages are installed
+  pkgng:
+    name: "{{ item }}"
+    state: present
+  with_items:
+    - bash
+    - ca_root_nss
 
-  - name: Ensure Sensu is installed
-    pkgng:
-      name: "{{ sensu_package }}"
-      state: "{{ sensu_pkg_state }}"
+- name: Ensure Sensu is installed
+  pkgng:
+    name: "{{ sensu_package }}"
+    state: "{{ sensu_pkg_state }}"

+ 5 - 5
tasks/FreeBSD/rabbit.yml

@@ -2,9 +2,9 @@
 # tasks/FreeBSD/rabbit.yml: Deploy RabbitMQ
 # Specific to FreeBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure RabbitMQ is installed
-    pkgng:
-      name: rabbitmq
-      state: "{{ rabbitmq_pkg_state }}"
+- name: Ensure RabbitMQ is installed
+  pkgng:
+    name: rabbitmq
+    state: "{{ rabbitmq_pkg_state }}"

+ 12 - 12
tasks/FreeBSD/redis.yml

@@ -2,18 +2,18 @@
 # tasks/FreeBSD/redis.yml: Deploy redis
 # Specific to FreeBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure redis is installed
-    pkgng:
-      name: "{{ redis_pkg_name }}"
-      state: "{{ redis_pkg_state }}"
+- name: Ensure redis is installed
+  pkgng:
+    name: "{{ redis_pkg_name }}"
+    state: "{{ redis_pkg_state }}"
 
-  - name: Ensure redis binds to accessible IP
-    lineinfile:
-      dest: /usr/local/etc/redis.conf
-      regexp: '^bind'
-      line: 'bind 0.0.0.0'
-    notify: restart redis service
+- name: Ensure redis binds to accessible IP
+  lineinfile:
+    dest: /usr/local/etc/redis.conf
+    regexp: '^bind'
+    line: 'bind 0.0.0.0'
+  notify: restart redis service
 
-  - meta: flush_handlers
+- meta: flush_handlers

+ 61 - 61
tasks/OpenBSD/dashboard.yml

@@ -2,73 +2,73 @@
 # tasks/OpenBSD/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to OpenBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure Uchiwa (dashboard) dependencies are installed
-    openbsd_pkg:
-      name: "{{ item }}"
-      state: present
-    with_items:
-      - go
-      - git
-      - npm
+- name: Ensure Uchiwa (dashboard) dependencies are installed
+  openbsd_pkg:
+    name: "{{ item }}"
+    state: present
+  with_items:
+    - go
+    - git
+    - npm
 
-  - name: Ensure Uchiwa directory exists
-    file:
-      dest: "{{ uchiwa_path }}"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      recurse: true
+- name: Ensure Uchiwa directory exists
+  file:
+    dest: "{{ uchiwa_path }}"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    recurse: true
 
-  - name: Ensure Uchiwa Go/config directory exists
-    file:
-      dest: "{{ uchiwa_path }}/{{ item }}"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      recurse: true
-    with_items:
-      - etc
-      - go
+- name: Ensure Uchiwa Go/config directory exists
+  file:
+    dest: "{{ uchiwa_path }}/{{ item }}"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    recurse: true
+  with_items:
+    - etc
+    - go
 
-  - name: Ensure Uchiwa GOPATH exists
-    file:
-      dest: "{{ uchiwa_path }}/go/{{ item }}"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      state: directory
-      recurse: true
-    with_items:
-      - bin
-      - pkg
-      - src
+- name: Ensure Uchiwa GOPATH exists
+  file:
+    dest: "{{ uchiwa_path }}/go/{{ item }}"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    state: directory
+    recurse: true
+  with_items:
+    - bin
+    - pkg
+    - src
 
-  - name: Fetch Uchiwa from GitHub
-    command: go get github.com/sensu/uchiwa
-    environment:
-      GOPATH: "{{ uchiwa_path }}/go"
-    args:
-      creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
-    notify: Build and deploy Uchiwa
-    become: true
-    become_user: "{{ sensu_user_name }}"
+- name: Fetch Uchiwa from GitHub
+  command: go get github.com/sensu/uchiwa
+  environment:
+    GOPATH: "{{ uchiwa_path }}/go"
+  args:
+    creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
+  notify: Build and deploy Uchiwa
+  become: true
+  become_user: "{{ sensu_user_name }}"
 
-  - meta: flush_handlers
+- meta: flush_handlers
 
-  - name: Deploy Uchiwa config
-    template:
-      src: uchiwa_config.json.j2
-      dest: "{{ uchiwa_path }}/etc/config.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    notify: restart uchiwa service
+- name: Deploy Uchiwa config
+  template:
+    src: uchiwa_config.json.j2
+    dest: "{{ uchiwa_path }}/etc/config.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  notify: restart uchiwa service
 
-  - name: Deploy Uchiwa service file
-    template:
-      src: uchiwa_openbsd.j2
-      dest: "/usr/local/etc/rc.d/uchiwa"
-      mode: "0755"
+- name: Deploy Uchiwa service file
+  template:
+    src: uchiwa_openbsd.j2
+    dest: "/usr/local/etc/rc.d/uchiwa"
+    mode: "0755"
 
-  - name: Ensure Uchiwa server service is running
-    service: name=uchiwa state=started enabled=yes
+- name: Ensure Uchiwa server service is running
+  service: name=uchiwa state=started enabled=yes

+ 54 - 54
tasks/OpenBSD/main.yml

@@ -2,57 +2,57 @@
 # tasks/OpenBSD/main.yml: OpenBSD specific set-up
 # This takes care of base prerequisites for OpenBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
-
-  - name: Ensure the Sensu group is present
-    group: name={{ sensu_group_name }} state=present
-
-  - name: Ensure the Sensu user is present
-    user:
-      name: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      shell: /bin/false
-      home: "{{ sensu_config_path }}"
-      createhome: true
-      state: present
-
-  - name: Install prerequisite packages
-    openbsd_pkg:
-      name: "{{ item }}"
-      state: present
-    with_items:
-      - bash
-      - ruby%2.3
-
-  - name: Get the current version of rubygems
-    shell: /usr/local/bin/gem23 --version
-    check_mode: no
-    register: gem23_version
-    changed_when: False
-
-  - name: Update rubygems to work around rubygems/rubygems/issues/1448
-    shell: /usr/local/bin/gem23 update --system
-    when: "{{ gem23_version.stdout | version_compare('2.5.3', '<') }}"
-
-  - name: Install sensu gem and all of its dependencies
-    gem:
-      name: sensu
-      repository: "{{ sensu_gem_repository | default('https://api.rubygems.org/')}}"
-      user_install: no
-      version: "{{ sensu_gem_version }}"
-      executable: /usr/local/bin/gem23
-
-  - name: Create the sensu log folder
-    file:
-      path: /var/log/sensu
-      owner: root
-      group: wheel
-      state: directory
-
-  - name: Deploy OpenBSD rc script
-    template:
-      src: sensuclient_openbsd.j2
-      dest: /etc/rc.d/sensuclient
-      owner: root
-      group: wheel
-      mode: 0755
+- include_vars: "{{ ansible_distribution }}.yml"
+
+- name: Ensure the Sensu group is present
+  group: name={{ sensu_group_name }} state=present
+
+- name: Ensure the Sensu user is present
+  user:
+    name: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    shell: /bin/false
+    home: "{{ sensu_config_path }}"
+    createhome: true
+    state: present
+
+- name: Install prerequisite packages
+  openbsd_pkg:
+    name: "{{ item }}"
+    state: present
+  with_items:
+    - bash
+    - ruby%2.3
+
+- name: Get the current version of rubygems
+  shell: /usr/local/bin/gem23 --version
+  check_mode: no
+  register: gem23_version
+  changed_when: False
+
+- name: Update rubygems to work around rubygems/rubygems/issues/1448
+  shell: /usr/local/bin/gem23 update --system
+  when: "{{ gem23_version.stdout | version_compare('2.5.3', '<') }}"
+
+- name: Install sensu gem and all of its dependencies
+  gem:
+    name: sensu
+    repository: "{{ sensu_gem_repository | default('https://api.rubygems.org/')}}"
+    user_install: no
+    version: "{{ sensu_gem_version }}"
+    executable: /usr/local/bin/gem23
+
+- name: Create the sensu log folder
+  file:
+    path: /var/log/sensu
+    owner: root
+    group: wheel
+    state: directory
+
+- name: Deploy OpenBSD rc script
+  template:
+    src: sensuclient_openbsd.j2
+    dest: /etc/rc.d/sensuclient
+    owner: root
+    group: wheel
+    mode: 0755

+ 5 - 5
tasks/OpenBSD/rabbit.yml

@@ -2,9 +2,9 @@
 # tasks/OpenBSD/rabbit.yml: Deploy RabbitMQ
 # Specific to OpenBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure RabbitMQ is installed
-    pkgng:
-      name: rabbitmq
-      state: "{{ rabbitmq_pkg_state }}"
+- name: Ensure RabbitMQ is installed
+  pkgng:
+    name: rabbitmq
+    state: "{{ rabbitmq_pkg_state }}"

+ 12 - 12
tasks/OpenBSD/redis.yml

@@ -2,18 +2,18 @@
 # tasks/OpenBSD/redis.yml: Deploy redis
 # Specific to OpenBSD
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure redis is installed
-    pkgng:
-      name: "{{ redis_pkg_name }}"
-      state: "{{ redis_pkg_state }}"
+- name: Ensure redis is installed
+  pkgng:
+    name: "{{ redis_pkg_name }}"
+    state: "{{ redis_pkg_state }}"
 
-  - name: Ensure redis binds to accessible IP
-    lineinfile:
-      dest: /usr/local/etc/redis.conf
-      regexp: '^bind'
-      line: 'bind 0.0.0.0'
-    notify: restart redis service
+- name: Ensure redis binds to accessible IP
+  lineinfile:
+    dest: /usr/local/etc/redis.conf
+    regexp: '^bind'
+    line: 'bind 0.0.0.0'
+  notify: restart redis service
 
-  - meta: flush_handlers
+- meta: flush_handlers

+ 12 - 12
tasks/SmartOS/client.yml

@@ -2,17 +2,17 @@
 # tasks/SmartOS/client.yml: Deploy various client-side configurations for Sensu
 # Specific to Joyent SmartOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Deploy Sensu client service manifest
-    template:
-      dest: /opt/local/lib/svc/manifest/sensu-client.xml
-      src: sensu-client.smartos_smf_manifest.xml.j2
-      owner: root
-      group: root
-      mode: 0644
-    notify:
-      - import sensu-client service
-      - restart sensu-client service
+- name: Deploy Sensu client service manifest
+  template:
+    dest: /opt/local/lib/svc/manifest/sensu-client.xml
+    src: sensu-client.smartos_smf_manifest.xml.j2
+    owner: root
+    group: root
+    mode: 0644
+  notify:
+    - import sensu-client service
+    - restart sensu-client service
 
-  - meta: flush_handlers
+- meta: flush_handlers

+ 67 - 67
tasks/SmartOS/dashboard.yml

@@ -2,81 +2,81 @@
 # tasks/SmartOS/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to Joyent SmartOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure Uchiwa (dashboard) dependencies are installed
-    pkgin: name=go state=present
+- name: Ensure Uchiwa (dashboard) dependencies are installed
+  pkgin: name=go state=present
 
-  - name: Ensure Uchiwa directory exists
-    file:
-      dest: "{{ uchiwa_path }}"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      recurse: true
+- name: Ensure Uchiwa directory exists
+  file:
+    dest: "{{ uchiwa_path }}"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    recurse: true
 
-  - name: Ensure Uchiwa Go/config directory exists
-    file:
-      dest: "{{ uchiwa_path }}/{{ item }}"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      recurse: true
-    with_items:
-      - etc
-      - go
+- name: Ensure Uchiwa Go/config directory exists
+  file:
+    dest: "{{ uchiwa_path }}/{{ item }}"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    recurse: true
+  with_items:
+    - etc
+    - go
 
-  - name: Ensure Uchiwa GOPATH exists
-    file:
-      dest: "{{ uchiwa_path }}/go/{{ item }}"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      state: directory
-      recurse: true
-    with_items:
-      - bin
-      - pkg
-      - src
+- name: Ensure Uchiwa GOPATH exists
+  file:
+    dest: "{{ uchiwa_path }}/go/{{ item }}"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    state: directory
+    recurse: true
+  with_items:
+    - bin
+    - pkg
+    - src
 
-  - name: Fetch Uchiwa from GitHub
-    command: go get github.com/sensu/uchiwa
-    environment:
-      GOPATH: "{{ uchiwa_path }}/go"
-    args:
-      creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
-    notify: Build and deploy Uchiwa
-    become: true
-    become_user: "{{ sensu_user_name }}"
+- name: Fetch Uchiwa from GitHub
+  command: go get github.com/sensu/uchiwa
+  environment:
+    GOPATH: "{{ uchiwa_path }}/go"
+  args:
+    creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
+  notify: Build and deploy Uchiwa
+  become: true
+  become_user: "{{ sensu_user_name }}"
 
-  - meta: flush_handlers
+- meta: flush_handlers
 
-  - name: Deploy Uchiwa config
-    template:
-      src: uchiwa_config.json.j2
-      dest: "{{ uchiwa_path }}/etc/config.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    notify: restart uchiwa service
+- name: Deploy Uchiwa config
+  template:
+    src: uchiwa_config.json.j2
+    dest: "{{ uchiwa_path }}/etc/config.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  notify: restart uchiwa service
 
-  - name: Deploy Uchiwa service script
-    template:
-      src: uchiwa.sh.j2
-      dest: /opt/local/lib/svc/method/uchiwa
-      owner: root
-      group: root
-      mode: 0755
-    notify: restart uchiwa service
+- name: Deploy Uchiwa service script
+  template:
+    src: uchiwa.sh.j2
+    dest: /opt/local/lib/svc/method/uchiwa
+    owner: root
+    group: root
+    mode: 0755
+  notify: restart uchiwa service
 
-  - name: Deploy Uchiwa service manifest
-    template:
-      dest: /opt/local/lib/svc/manifest/uchiwa.xml
-      src: uchiwa.smartos_smf_manifest.xml.j2
-      owner: root
-      group: root
-      mode: 644
-    notify: import uchiwa service
+- name: Deploy Uchiwa service manifest
+  template:
+    dest: /opt/local/lib/svc/manifest/uchiwa.xml
+    src: uchiwa.smartos_smf_manifest.xml.j2
+    owner: root
+    group: root
+    mode: 644
+  notify: import uchiwa service
 
-  - meta: flush_handlers
+- meta: flush_handlers
 
-  - name: Ensure Uchiwa server service is running
-    service: name=uchiwa state=started enabled=yes
+- name: Ensure Uchiwa server service is running
+  service: name=uchiwa state=started enabled=yes

+ 19 - 19
tasks/SmartOS/main.yml

@@ -2,27 +2,27 @@
 # tasks/SmartOS/main.yml: "Set-up" playbook for sensu.sensu role
 # This takes care of base prerequisites for Joyent SmartOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure the Sensu group is present
-    group: name={{ sensu_group_name }} state=present
+- name: Ensure the Sensu group is present
+  group: name={{ sensu_group_name }} state=present
 
-  - name: Ensure the Sensu user is present
-    user:
-      name: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      shell: /bin/false
-      home: "{{ sensu_config_path }}"
-      createhome: true
-      state: present
+- name: Ensure the Sensu user is present
+  user:
+    name: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    shell: /bin/false
+    home: "{{ sensu_config_path }}"
+    createhome: true
+    state: present
 
-  - name: Ensure Sensu dependencies are installed
-    pkgin: name=build-essential,ruby21-base state=present
+- name: Ensure Sensu dependencies are installed
+  pkgin: name=build-essential,ruby21-base state=present
 
-  - name: Ensure Sensu is installed
-    gem: name=sensu state={{ sensu_gem_state }} user_install=no
-    notify:
-      - restart sensu-client service
+- name: Ensure Sensu is installed
+  gem: name=sensu state={{ sensu_gem_state }} user_install=no
+  notify:
+    - restart sensu-client service
 
-  - name: Ensure Sensu 'plugins' gem is installed
-    gem: name=sensu-plugin state={{ sensu_plugin_gem_state }} user_install=no
+- name: Ensure Sensu 'plugins' gem is installed
+  gem: name=sensu-plugin state={{ sensu_plugin_gem_state }} user_install=no

+ 7 - 7
tasks/SmartOS/rabbit.yml

@@ -2,11 +2,11 @@
 # tasks/SmartOS/rabbit.yml: Deploy RabbitMQ
 # Specific to Joyent SmartOS
 
-  - name: Ensure RabbitMQ is installed
-    pkgin: name=rabbitmq state=present
+- name: Ensure RabbitMQ is installed
+  pkgin: name=rabbitmq state=present
 
-  - name: Ensure EPMD is running
-    service:
-      name: epmd
-      state: started
-      enabled: true
+- name: Ensure EPMD is running
+  service:
+    name: epmd
+    state: started
+    enabled: true

+ 3 - 3
tasks/SmartOS/redis.yml

@@ -2,7 +2,7 @@
 # tasks/SmartOS/redis.yml: Deploy redis
 # Specific to Ubuntu
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure redis is installed
-    pkgin: name=redis state={{ redis_pkg_state }}
+- name: Ensure redis is installed
+  pkgin: name=redis state={{ redis_pkg_state }}

+ 18 - 18
tasks/SmartOS/server.yml

@@ -3,24 +3,24 @@
 # a Sensu 'master' node.
 # Specific to SmartOS
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Deploy Sensu server service manifest
-    template:
-      dest: /opt/local/lib/svc/manifest/sensu-server.xml
-      src: sensu-server.smartos_smf_manifest.xml.j2
-      owner: root
-      group: root
-      mode: 0644
-    notify: import sensu-server service
+- name: Deploy Sensu server service manifest
+  template:
+    dest: /opt/local/lib/svc/manifest/sensu-server.xml
+    src: sensu-server.smartos_smf_manifest.xml.j2
+    owner: root
+    group: root
+    mode: 0644
+  notify: import sensu-server service
 
-  - name: Deploy Sensu API service manifest
-    template:
-      dest: /opt/local/lib/svc/manifest/sensu-api.xml
-      src: sensu-api.smartos_smf_manifest.xml.j2
-      owner: root
-      group: root
-      mode: 0644
-    notify: import sensu-api service
+- name: Deploy Sensu API service manifest
+  template:
+    dest: /opt/local/lib/svc/manifest/sensu-api.xml
+    src: sensu-api.smartos_smf_manifest.xml.j2
+    owner: root
+    group: root
+    mode: 0644
+  notify: import sensu-api service
 
-  - meta: flush_handlers
+- meta: flush_handlers

+ 10 - 10
tasks/Ubuntu/dashboard.yml

@@ -2,15 +2,15 @@
 # tasks/Ubuntu/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to Ubuntu
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Install Uchiwa
-    apt:
-      name: uchiwa
-      state: present
+- name: Install Uchiwa
+  apt:
+    name: uchiwa
+    state: present
 
-  - name: Deploy Uchiwa config
-    template:
-      src: uchiwa_config.json.j2
-      dest: "{{ sensu_config_path }}/uchiwa.json"
-    notify: restart uchiwa service
+- name: Deploy Uchiwa config
+  template:
+    src: uchiwa_config.json.j2
+    dest: "{{ sensu_config_path }}/uchiwa.json"
+  notify: restart uchiwa service

+ 20 - 20
tasks/Ubuntu/main.yml

@@ -2,27 +2,27 @@
 # tasks/Ubuntu/main.yml: Ubuntu specific set-up
 # This takes care of base prerequisites for Ubuntu
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure that https transport is ready
-    apt:
-      name: apt-transport-https
-      state: present
-      cache_valid_time: 3600
-      update_cache: true
+- name: Ensure that https transport is ready
+  apt:
+    name: apt-transport-https
+    state: present
+    cache_valid_time: 3600
+    update_cache: true
 
-  - name: Ensure the Sensu APT repo GPG key is present
-    apt_key:
-      url: "{{ sensu_apt_key_url }}"
-      state: present
+- name: Ensure the Sensu APT repo GPG key is present
+  apt_key:
+    url: "{{ sensu_apt_key_url }}"
+    state: present
 
-  - name: Ensure the Sensu Core APT repo is present
-    apt_repository:
-      repo: "{{ sensu_apt_repo_url }}"
-      state: present
-      update_cache: true
+- name: Ensure the Sensu Core APT repo is present
+  apt_repository:
+    repo: "{{ sensu_apt_repo_url }}"
+    state: present
+    update_cache: true
 
-  - name: Ensure Sensu is installed
-    apt:
-      name: "{{ sensu_package }}"
-      state: "{{ sensu_pkg_state }}"
+- name: Ensure Sensu is installed
+  apt:
+    name: "{{ sensu_package }}"
+    state: "{{ sensu_pkg_state }}"

+ 27 - 27
tasks/Ubuntu/rabbit.yml

@@ -2,35 +2,35 @@
 # tasks/Ubuntu/rabbit.yml: Deploy RabbitMQ
 # Specific to Ubuntu
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure the RabbitMQ APT repo GPG key is present
-    apt_key:
-      url: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-      state: present
+- name: Ensure the RabbitMQ APT repo GPG key is present
+  apt_key:
+    url: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+    state: present
 
-  - name: Ensure the RabbitMQ APT repo is present
-    apt_repository:
-      repo: "{{ sensu_rabbitmq_repo }}"
-      filename: rabbitmq
-      state: present
-      update_cache: true
+- name: Ensure the RabbitMQ APT repo is present
+  apt_repository:
+    repo: "{{ sensu_rabbitmq_repo }}"
+    filename: rabbitmq
+    state: present
+    update_cache: true
 
-  - name: Ensure the Erlang APT repo GPG key is present
-    apt_key:
-      url: https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
-      state: present
+- name: Ensure the Erlang APT repo GPG key is present
+  apt_key:
+    url: https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
+    state: present
 
-  - name: Ensure the Erlang APT repo is present
-    apt_repository:
-      repo: "{{ sensu_rabbitmq_erlang_repo }}"
-      filename: erlang
-      state: present
-      update_cache: true
+- name: Ensure the Erlang APT repo is present
+  apt_repository:
+    repo: "{{ sensu_rabbitmq_erlang_repo }}"
+    filename: erlang
+    state: present
+    update_cache: true
 
-  - name: Ensure RabbitMQ is installed
-    apt:
-      name: rabbitmq-server
-      state: "{{ rabbitmq_pkg_state }}"
-      cache_valid_time: 600
-      update_cache: true
+- name: Ensure RabbitMQ is installed
+  apt:
+    name: rabbitmq-server
+    state: "{{ rabbitmq_pkg_state }}"
+    cache_valid_time: 600
+    update_cache: true

+ 23 - 23
tasks/Ubuntu/redis.yml

@@ -2,30 +2,30 @@
 # tasks/Ubuntu/redis.yml: Deploy redis
 # Specific to Ubuntu
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure redis is installed
-    apt:
-      name: "{{ redis_pkg_name }}"
-      state: "{{ redis_pkg_state }}"
-      update_cache: true
-    register: sensu_ubuntu_redis_install
+- name: Ensure redis is installed
+  apt:
+    name: "{{ redis_pkg_name }}"
+    state: "{{ redis_pkg_state }}"
+    update_cache: true
+  register: sensu_ubuntu_redis_install
 
-    # BUG: On Ubuntu 14.04, when first installed, redis, will be started
-    # however, the /var/run/redis/redis-server.pid file gets lost during the restart
-    # causing the process to be orphaned from the init system.
-    # We manually stop it right after install to account for this.
-  - name: Stop redis manually
-    shell: kill $(pgrep redis-server)
-    when:
-      - sensu_ubuntu_redis_install is changed
-      - ansible_distribution_version == '14.04'
+  # BUG: On Ubuntu 14.04, when first installed, redis, will be started
+  # however, the /var/run/redis/redis-server.pid file gets lost during the restart
+  # causing the process to be orphaned from the init system.
+  # We manually stop it right after install to account for this.
+- name: Stop redis manually
+  shell: kill $(pgrep redis-server)
+  when:
+    - sensu_ubuntu_redis_install is changed
+    - ansible_distribution_version == '14.04'
 
-  - name: Ensure redis binds to accessible IP
-    lineinfile:
-      dest: /etc/redis/redis.conf
-      regexp: '^bind'
-      line: 'bind 0.0.0.0'
-    notify: restart redis service
+- name: Ensure redis binds to accessible IP
+  lineinfile:
+    dest: /etc/redis/redis.conf
+    regexp: '^bind'
+    line: 'bind 0.0.0.0'
+  notify: restart redis service
 
-  - meta: flush_handlers
+- meta: flush_handlers

+ 17 - 17
tasks/client.yml

@@ -1,23 +1,23 @@
 ---
 # tasks/client.yml: Deploy various client-side configurations for Sensu
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Deploy Sensu client service configuration
-    template:
-      dest: "{{ sensu_config_path }}/conf.d/client.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      src: "{{ sensu_client_config  }}"
-      mode: "0640"
-    notify: restart sensu-client service
+- name: Deploy Sensu client service configuration
+  template:
+    dest: "{{ sensu_config_path }}/conf.d/client.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    src: "{{ sensu_client_config  }}"
+    mode: "0640"
+  notify: restart sensu-client service
 
-  - include: "{{ role_path }}/tasks/SmartOS/client.yml"
-    when: ansible_distribution == "SmartOS"
-    static: false
+- include: "{{ role_path }}/tasks/SmartOS/client.yml"
+  when: ansible_distribution == "SmartOS"
+  static: false
 
-  - name: Ensure Sensu client service is running
-    service:
-      name: "{{ sensu_client_service_name }}"
-      state: started
-      enabled: yes
+- name: Ensure Sensu client service is running
+  service:
+    name: "{{ sensu_client_service_name }}"
+    state: started
+    enabled: yes

+ 48 - 48
tasks/common.yml

@@ -1,55 +1,55 @@
 ---
 # tasks/common.yml: Deploy configurations common to client and server for Sensu
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure the Sensu config directory is present
-    file:
-      dest: "{{ sensu_config_path }}/conf.d"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      mode: "0555"
+- name: Ensure the Sensu config directory is present
+  file:
+    dest: "{{ sensu_config_path }}/conf.d"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    mode: "0555"
 
-  - name: Deploy Sensu Redis configuration
-    template:
-      dest: "{{ sensu_config_path }}/conf.d/redis.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      src: "{{ sensu_redis_config }}"
-      mode: "0640"
-    when: sensu_deploy_redis_config
-    notify:
-      - restart sensu-server service
-      - restart sensu-api service
-      - restart sensu-enterprise service
-      - restart sensu-client service
+- name: Deploy Sensu Redis configuration
+  template:
+    dest: "{{ sensu_config_path }}/conf.d/redis.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    src: "{{ sensu_redis_config }}"
+    mode: "0640"
+  when: sensu_deploy_redis_config
+  notify:
+    - restart sensu-server service
+    - restart sensu-api service
+    - restart sensu-enterprise service
+    - restart sensu-client service
 
-  - name: Deploy Sensu RabbitMQ configuration
-    template:
-      dest: "{{ sensu_config_path }}/conf.d/rabbitmq.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      src: "{{ sensu_rabbitmq_config }}"
-      mode: "0640"
-    when: sensu_transport == "rabbitmq"
-          and sensu_deploy_rabbitmq_config
-    notify:
-      - restart sensu-server service
-      - restart sensu-api service
-      - restart sensu-enterprise service
-      - restart sensu-client service
+- name: Deploy Sensu RabbitMQ configuration
+  template:
+    dest: "{{ sensu_config_path }}/conf.d/rabbitmq.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    src: "{{ sensu_rabbitmq_config }}"
+    mode: "0640"
+  when: sensu_transport == "rabbitmq"
+        and sensu_deploy_rabbitmq_config
+  notify:
+    - restart sensu-server service
+    - restart sensu-api service
+    - restart sensu-enterprise service
+    - restart sensu-client service
 
-  - name: Deploy Sensu transport configuration
-    template:
-      dest: "{{ sensu_config_path }}/conf.d/transport.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      src: transport.json.j2
-      mode: "0640"
-    when: sensu_deploy_transport_config
-    notify:
-      - restart sensu-server service
-      - restart sensu-api service
-      - restart sensu-enterprise service
-      - restart sensu-client service
+- name: Deploy Sensu transport configuration
+  template:
+    dest: "{{ sensu_config_path }}/conf.d/transport.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    src: transport.json.j2
+    mode: "0640"
+  when: sensu_deploy_transport_config
+  notify:
+    - restart sensu-server service
+    - restart sensu-api service
+    - restart sensu-enterprise service
+    - restart sensu-client service

+ 6 - 6
tasks/dashboard.yml

@@ -1,9 +1,9 @@
 ---
 # tasks/dashboard.yml: Deployment of the Uchiwa dashboard
-  - include: "{{ role_path }}/tasks/{{ ansible_distribution }}/dashboard.yml"
+- include: "{{ role_path }}/tasks/{{ ansible_distribution }}/dashboard.yml"
 
-  - name: Ensure Uchiwa/Sensu Enterprise Dashboard server service is running
-    service:
-      name: "{{ uchiwa_service_name if not se_enterprise else sensu_enterprise_dashboard_service_name }}"
-      state: started
-      enabled: yes
+- name: Ensure Uchiwa/Sensu Enterprise Dashboard server service is running
+  service:
+    name: "{{ uchiwa_service_name if not se_enterprise else sensu_enterprise_dashboard_service_name }}"
+    state: started
+    enabled: yes

+ 45 - 45
tasks/main.yml

@@ -1,48 +1,48 @@
 ---
 # tasks/main.yml: "Master" playbook for the sensu.sensu role
 
-  - include_vars: "{{ ansible_distribution }}.yml"
-
-  - include: "{{ role_path }}/tasks/{{ ansible_distribution }}/main.yml"
-    tags: setup
-    when: sensu_master
-          or sensu_client
-
-  - include: "{{ role_path }}/tasks/redis.yml"
-    tags: redis
-    when: redis_server
-          and sensu_deploy_redis_server
-    static: false
-
-  - include: "{{ role_path }}/tasks/ssl.yml"
-    tags: ssl
-
-  - include: "{{ role_path }}/tasks/rabbit.yml"
-    tags: rabbitmq
-    when: rabbitmq_server
-          and sensu_deploy_rabbitmq_server
-    static: false
-
-  - include: "{{ role_path }}/tasks/common.yml"
-    tags: common
-    when: sensu_master
-          or sensu_client
-
-  - include: "{{ role_path }}/tasks/server.yml"
-    tags: server
-    when: sensu_master
-    static: false
-
-  - include: "{{ role_path }}/tasks/dashboard.yml"
-    tags: dashboard
-    when: sensu_include_dashboard
-    static: false
-
-  - include: "{{ role_path }}/tasks/client.yml"
-    tags: client
-    when: sensu_client
-
-  - include: "{{ role_path }}/tasks/plugins.yml"
-    tags: plugins
-    when: sensu_include_plugins
-    static: false
+- include_vars: "{{ ansible_distribution }}.yml"
+
+- include: "{{ role_path }}/tasks/{{ ansible_distribution }}/main.yml"
+  tags: setup
+  when: sensu_master
+        or sensu_client
+
+- include: "{{ role_path }}/tasks/redis.yml"
+  tags: redis
+  when: redis_server
+        and sensu_deploy_redis_server
+  static: false
+
+- include: "{{ role_path }}/tasks/ssl.yml"
+  tags: ssl
+
+- include: "{{ role_path }}/tasks/rabbit.yml"
+  tags: rabbitmq
+  when: rabbitmq_server
+        and sensu_deploy_rabbitmq_server
+  static: false
+
+- include: "{{ role_path }}/tasks/common.yml"
+  tags: common
+  when: sensu_master
+        or sensu_client
+
+- include: "{{ role_path }}/tasks/server.yml"
+  tags: server
+  when: sensu_master
+  static: false
+
+- include: "{{ role_path }}/tasks/dashboard.yml"
+  tags: dashboard
+  when: sensu_include_dashboard
+  static: false
+
+- include: "{{ role_path }}/tasks/client.yml"
+  tags: client
+  when: sensu_client
+
+- include: "{{ role_path }}/tasks/plugins.yml"
+  tags: plugins
+  when: sensu_include_plugins
+  static: false

+ 90 - 90
tasks/plugins.yml

@@ -1,104 +1,104 @@
 ---
 # tasks/plugins.yml: Deploy available checks/plugins/handlers/filters/mutators
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure Sensu plugin directory exists
-    file:
-      dest: "{{ sensu_config_path }}/plugins"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
+- name: Ensure Sensu plugin directory exists
+  file:
+    dest: "{{ sensu_config_path }}/plugins"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
 
-  - name: Ensure local directories exist
-    local_action: file state=directory dest="{{ static_data_store }}/sensu/{{ item }}"
-    become: no
-    with_items:
-      - checks
-      - filters
-      - handlers
-      - mutators
-      - definitions
-      - client_definitions
+- name: Ensure local directories exist
+  local_action: file state=directory dest="{{ static_data_store }}/sensu/{{ item }}"
+  become: no
+  with_items:
+    - checks
+    - filters
+    - handlers
+    - mutators
+    - definitions
+    - client_definitions
 
-  - name: Ensure any remote plugins defined are present
-    shell: umask 0022; sensu-install -p {{ item }}
-    with_items: "{{ sensu_remote_plugins }}"
-    changed_when: false
-    when: sensu_remote_plugins | length > 0
+- name: Ensure any remote plugins defined are present
+  shell: umask 0022; sensu-install -p {{ item }}
+  with_items: "{{ sensu_remote_plugins }}"
+  changed_when: false
+  when: sensu_remote_plugins | length > 0
 
-  - name: Register available checks
-    local_action: command ls {{ static_data_store }}/sensu/checks
-    register: sensu_available_checks
-    changed_when: false
-    become: false
+- name: Register available checks
+  local_action: command ls {{ static_data_store }}/sensu/checks
+  register: sensu_available_checks
+  changed_when: false
+  become: false
 
-  - name: Deploy check plugins
-    copy:
-      src: "{{ static_data_store }}/sensu/checks/{{ item }}/"
-      dest: "{{ sensu_config_path }}/plugins/"
-      mode: 0755
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    when: "sensu_available_checks is defined and item in sensu_available_checks.stdout_lines"
-    with_flattened:
-      - "{{ group_names }}"
-    notify: restart sensu-client service
+- name: Deploy check plugins
+  copy:
+    src: "{{ static_data_store }}/sensu/checks/{{ item }}/"
+    dest: "{{ sensu_config_path }}/plugins/"
+    mode: 0755
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  when: "sensu_available_checks is defined and item in sensu_available_checks.stdout_lines"
+  with_flattened:
+    - "{{ group_names }}"
+  notify: restart sensu-client service
 
-  - name: Deploy handler plugins
-    copy:
-      src: "{{ static_data_store }}/sensu/handlers/"
-      dest: "{{ sensu_config_path }}/plugins/"
-      mode: 0755
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    notify: restart sensu-client service
+- name: Deploy handler plugins
+  copy:
+    src: "{{ static_data_store }}/sensu/handlers/"
+    dest: "{{ sensu_config_path }}/plugins/"
+    mode: 0755
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  notify: restart sensu-client service
 
-  - name: Deploy filter plugins
-    copy:
-      src: "{{ static_data_store }}/sensu/filters/"
-      dest: "{{ sensu_config_path }}/plugins/"
-      mode: 0755
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    notify: restart sensu-client service
+- name: Deploy filter plugins
+  copy:
+    src: "{{ static_data_store }}/sensu/filters/"
+    dest: "{{ sensu_config_path }}/plugins/"
+    mode: 0755
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  notify: restart sensu-client service
 
-  - name: Deploy mutator plugins
-    copy:
-      src: "{{ static_data_store }}/sensu/mutators/"
-      dest: "{{ sensu_config_path }}/plugins/"
-      mode: 0755
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    notify: restart sensu-client service
+- name: Deploy mutator plugins
+  copy:
+    src: "{{ static_data_store }}/sensu/mutators/"
+    dest: "{{ sensu_config_path }}/plugins/"
+    mode: 0755
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  notify: restart sensu-client service
 
-  - name: Deploy check/handler/filter/mutator definitions to the master
-    template:
-      src: "{{ item }}"
-      dest: "{{ sensu_config_path }}/conf.d/{{ item | basename | regex_replace('.j2', '')}}"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    when: sensu_master
-    with_fileglob:
-      - "{{ static_data_store }}/sensu/definitions/*"
-    notify:
-      - restart sensu-server service
-      - restart sensu-api service
-      - restart sensu-enterprise service
+- name: Deploy check/handler/filter/mutator definitions to the master
+  template:
+    src: "{{ item }}"
+    dest: "{{ sensu_config_path }}/conf.d/{{ item | basename | regex_replace('.j2', '')}}"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  when: sensu_master
+  with_fileglob:
+    - "{{ static_data_store }}/sensu/definitions/*"
+  notify:
+    - restart sensu-server service
+    - restart sensu-api service
+    - restart sensu-enterprise service
 
-  - name: Register available client definitions
-    local_action: command ls {{ static_data_store }}/sensu/client_definitions
-    register: sensu_available_client_definitions
-    changed_when: false
-    become: false
+- name: Register available client definitions
+  local_action: command ls {{ static_data_store }}/sensu/client_definitions
+  register: sensu_available_client_definitions
+  changed_when: false
+  become: false
 
-  - name: Deploy client definitions
-    copy:
-      src: "{{ static_data_store }}/sensu/client_definitions/{{ item }}/"
-      dest: "{{ sensu_config_path }}/conf.d/{{ item | basename | regex_replace('.j2', '')}}"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    when: "sensu_available_client_definitions is defined and item in sensu_available_client_definitions.stdout_lines"
-    with_flattened:
-      - "{{ group_names }}"
-    notify: restart sensu-client service
+- name: Deploy client definitions
+  copy:
+    src: "{{ static_data_store }}/sensu/client_definitions/{{ item }}/"
+    dest: "{{ sensu_config_path }}/conf.d/{{ item | basename | regex_replace('.j2', '')}}"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  when: "sensu_available_client_definitions is defined and item in sensu_available_client_definitions.stdout_lines"
+  with_flattened:
+    - "{{ group_names }}"
+  notify: restart sensu-client service

+ 43 - 43
tasks/rabbit.yml

@@ -1,47 +1,47 @@
 ---
 # tasks/rabbit.yml: Deploy RabbitMQ and set-up vhost for Sensu messaging
 
-  - include_vars: "{{ ansible_distribution }}.yml"
-
-  - include: "{{ ansible_distribution }}/rabbit.yml"
-
-  - name: Ensure RabbitMQ SSL directory exists
-    file: dest={{ rabbitmq_config_path }}/ssl state=directory
-
-  - name: Ensure RabbitMQ SSL certs/keys are in place
-    copy: src="{{ item.src }}" dest="{{ rabbitmq_config_path }}/ssl/{{ item.dest }}" remote_src="{{ sensu_ssl_deploy_remote_src }}"
-    with_items:
-      - { src: "{{ sensu_ssl_server_cacert }}", dest: cacert.pem }
-      - { src: "{{ sensu_ssl_server_cert }}", dest: cert.pem }
-      - { src: "{{ sensu_ssl_server_key }}", dest: key.pem }
-    notify:
-      - restart rabbitmq service
-      - restart sensu-api service
-      - restart sensu-server service
-      - restart sensu-enterprise service
-    when: sensu_ssl_manage_certs
-
-  - name: Deploy RabbitMQ config
-    template:
-      dest: "{{ rabbitmq_config_path }}/rabbitmq.config"
-      src: "{{ rabbitmq_config_template }}"
-      owner: root
-      group: "{{ __root_group }}"
-      mode: 0644
-    notify: restart rabbitmq service
-
-  - name: Ensure RabbitMQ is running
-    service:
-      name: "{{ rabbitmq_service_name }}"
-      state: started
-      enabled: true
-    register: rabbitmq_state
-
-  - name: Wait for RabbitMQ to be up and running before asking to create a vhost
-    pause: seconds=3
-    when: rabbitmq_state|changed
-
-  - block:
+- include_vars: "{{ ansible_distribution }}.yml"
+
+- include: "{{ ansible_distribution }}/rabbit.yml"
+
+- name: Ensure RabbitMQ SSL directory exists
+  file: dest={{ rabbitmq_config_path }}/ssl state=directory
+
+- name: Ensure RabbitMQ SSL certs/keys are in place
+  copy: src="{{ item.src }}" dest="{{ rabbitmq_config_path }}/ssl/{{ item.dest }}" remote_src="{{ sensu_ssl_deploy_remote_src }}"
+  with_items:
+    - { src: "{{ sensu_ssl_server_cacert }}", dest: cacert.pem }
+    - { src: "{{ sensu_ssl_server_cert }}", dest: cert.pem }
+    - { src: "{{ sensu_ssl_server_key }}", dest: key.pem }
+  notify:
+    - restart rabbitmq service
+    - restart sensu-api service
+    - restart sensu-server service
+    - restart sensu-enterprise service
+  when: sensu_ssl_manage_certs
+
+- name: Deploy RabbitMQ config
+  template:
+    dest: "{{ rabbitmq_config_path }}/rabbitmq.config"
+    src: "{{ rabbitmq_config_template }}"
+    owner: root
+    group: "{{ __root_group }}"
+    mode: 0644
+  notify: restart rabbitmq service
+
+- name: Ensure RabbitMQ is running
+  service:
+    name: "{{ rabbitmq_service_name }}"
+    state: started
+    enabled: true
+  register: rabbitmq_state
+
+- name: Wait for RabbitMQ to be up and running before asking to create a vhost
+  pause: seconds=3
+  when: rabbitmq_state|changed
+
+- block:
     - name: Ensure Sensu RabbitMQ vhost exists
       rabbitmq_vhost: name={{ rabbitmq_sensu_vhost }} state=present
 
@@ -54,5 +54,5 @@
         read_priv: .*
         write_priv: .*
         state: present
-    become: true
-    become_user: rabbitmq
+  become: true
+  become_user: rabbitmq

+ 7 - 7
tasks/redis.yml

@@ -1,11 +1,11 @@
 ---
 # tasks/redis.yml: Deploy redis
 
-  - include: "{{ role_path }}/tasks/{{ ansible_distribution }}/redis.yml"
+- include: "{{ role_path }}/tasks/{{ ansible_distribution }}/redis.yml"
 
-  - name: Ensure redis is running
-    service:
-      name: "{{ redis_service_name }}"
-      pattern: /usr/bin/redis-server
-      state: started
-      enabled: true
+- name: Ensure redis is running
+  service:
+    name: "{{ redis_service_name }}"
+    pattern: /usr/bin/redis-server
+    state: started
+    enabled: true

+ 16 - 16
tasks/server.yml

@@ -1,23 +1,23 @@
 ---
 # tasks/server.yml: Deploy Sensu Server/API
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Deploy Sensu server API configuration
-    template:
-      dest: "{{ sensu_config_path }}/conf.d/api.json"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-      src: sensu-api.json.j2
-    notify: restart sensu-api service
+- name: Deploy Sensu server API configuration
+  template:
+    dest: "{{ sensu_config_path }}/conf.d/api.json"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+    src: sensu-api.json.j2
+  notify: restart sensu-api service
 
-  - include: "{{ role_path }}/tasks/SmartOS/server.yml"
-    when: ansible_distribution == "SmartOS"
-    static: false
+- include: "{{ role_path }}/tasks/SmartOS/server.yml"
+  when: ansible_distribution == "SmartOS"
+  static: false
 
-  - name: Ensure Sensu server service is running
-    service: name={{ sensu_server_service_name if not se_enterprise else sensu_enterprise_service_name }} state=started enabled=yes
+- name: Ensure Sensu server service is running
+  service: name={{ sensu_server_service_name if not se_enterprise else sensu_enterprise_service_name }} state=started enabled=yes
 
-  - name: Ensure Sensu API service is running
-    service: name=sensu-api state=started enabled=yes
-    when: not se_enterprise
+- name: Ensure Sensu API service is running
+  service: name=sensu-api state=started enabled=yes
+  when: not se_enterprise

+ 24 - 24
tasks/ssl.yml

@@ -1,30 +1,30 @@
 ---
 # tasks/ssl.yml: Deploy the client SSL cert/key to client systems
 
-  - include_vars: "{{ ansible_distribution }}.yml"
+- include_vars: "{{ ansible_distribution }}.yml"
 
-  - name: Ensure Sensu SSL directory exists
-    file:
-      dest: "{{ sensu_config_path }}/ssl"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    when: sensu_ssl_manage_certs
+- name: Ensure Sensu SSL directory exists
+  file:
+    dest: "{{ sensu_config_path }}/ssl"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  when: sensu_ssl_manage_certs
 
-  - include: "{{ role_path }}/tasks/ssl_generate.yml"
-    when: sensu_ssl_gen_certs
-    static: false
+- include: "{{ role_path }}/tasks/ssl_generate.yml"
+  when: sensu_ssl_gen_certs
+  static: false
 
-  - name: Deploy the Sensu client SSL cert/key
-    copy:
-      src: "{{ item.src }}"
-      owner: "{{ sensu_user_name }}"
-      remote_src: "{{ sensu_ssl_deploy_remote_src }}"
-      group: "{{ sensu_group_name }}"
-      dest: "{{ sensu_config_path }}/ssl/{{ item.dest }}"
-      mode: " {{ item.perm }}"
-    with_items:
-      - {src: "{{ sensu_ssl_client_cert }}", dest: cert.pem , perm: "0640" }
-      - {src: "{{ sensu_ssl_client_key }}", dest: key.pem  , perm: "0640" }
-    notify: restart sensu-client service
-    when: sensu_ssl_manage_certs
+- name: Deploy the Sensu client SSL cert/key
+  copy:
+    src: "{{ item.src }}"
+    owner: "{{ sensu_user_name }}"
+    remote_src: "{{ sensu_ssl_deploy_remote_src }}"
+    group: "{{ sensu_group_name }}"
+    dest: "{{ sensu_config_path }}/ssl/{{ item.dest }}"
+    mode: " {{ item.perm }}"
+  with_items:
+    - {src: "{{ sensu_ssl_client_cert }}", dest: cert.pem, perm: "0640" }
+    - {src: "{{ sensu_ssl_client_key }}", dest: key.pem, perm: "0640" }
+  notify: restart sensu-client service
+  when: sensu_ssl_manage_certs

+ 48 - 48
tasks/ssl_generate.yml

@@ -2,38 +2,38 @@
 # tasks/ssl_generate.yml: Generate SSL data and stash to dynamic
 # data store for deployment to clients
 
-  - include_vars: "{{ ansible_distribution }}.yml"
-
-  - name: Ensure OpenSSL is installed
-    package:
-      name: openssl
-      state: present
-
-  - name: Ensure SSL generation directory exists
-    file:
-      dest: "{{ sensu_config_path }}/{{ item }}"
-      state: directory
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    when: sensu_master
-    with_items:
-      - ssl_generation
-      - ssl_generation/sensu_ssl_tool
-      - ssl_generation/sensu_ssl_tool/client
-      - ssl_generation/sensu_ssl_tool/server
-      - ssl_generation/sensu_ssl_tool/sensu_ca
-      - ssl_generation/sensu_ssl_tool/sensu_ca/private
-      - ssl_generation/sensu_ssl_tool/sensu_ca/certs
-
-  - name: Ensure OpenSSL configuration is in place
-    template:
-      src: openssl.cnf.j2
-      dest: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool/sensu_ca/openssl.cnf"
-      owner: "{{ sensu_user_name }}"
-      group: "{{ sensu_group_name }}"
-    when: sensu_master
-
-  - block:
+- include_vars: "{{ ansible_distribution }}.yml"
+
+- name: Ensure OpenSSL is installed
+  package:
+    name: openssl
+    state: present
+
+- name: Ensure SSL generation directory exists
+  file:
+    dest: "{{ sensu_config_path }}/{{ item }}"
+    state: directory
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  when: sensu_master
+  with_items:
+    - ssl_generation
+    - ssl_generation/sensu_ssl_tool
+    - ssl_generation/sensu_ssl_tool/client
+    - ssl_generation/sensu_ssl_tool/server
+    - ssl_generation/sensu_ssl_tool/sensu_ca
+    - ssl_generation/sensu_ssl_tool/sensu_ca/private
+    - ssl_generation/sensu_ssl_tool/sensu_ca/certs
+
+- name: Ensure OpenSSL configuration is in place
+  template:
+    src: openssl.cnf.j2
+    dest: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool/sensu_ca/openssl.cnf"
+    owner: "{{ sensu_user_name }}"
+    group: "{{ sensu_group_name }}"
+  when: sensu_master
+
+- block:
     - name: Ensure the Sensu CA serial configuration
       shell: 'echo 01 > sensu_ca/serial'
       args:
@@ -47,7 +47,7 @@
         state: touch
       when: sensu_ca_new_serial is changed
 
-      #TODO: The following mirrors the commands used in sensu_ssl_tool/ssl_certs.sh
+      # TODO: The following mirrors the commands used in sensu_ssl_tool/ssl_certs.sh
       # from the 1.3 version of the script. Ideally, this moves into the native openssl_* modules.
       # See https://docs.sensu.io/sensu-core/1.3/reference/ssl/#reference-documentation for limitations and further instructions
     - name: Generate Sensu CA certificate
@@ -110,18 +110,18 @@
         chdir: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool/client"
         creates: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool/client/keycert.p12"
 
-    when: sensu_master|bool
-    become: true
-    become_user: "{{ sensu_user_name }}"
-
-  - name: Stash the Sensu SSL certs/keys
-    fetch:
-      src: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool/{{ item }}"
-      dest: "{{ dynamic_data_store }}"
-    when: sensu_master
-    with_items:
-      - sensu_ca/cacert.pem
-      - server/cert.pem
-      - server/key.pem
-      - client/cert.pem
-      - client/key.pem
+  when: sensu_master|bool
+  become: true
+  become_user: "{{ sensu_user_name }}"
+
+- name: Stash the Sensu SSL certs/keys
+  fetch:
+    src: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool/{{ item }}"
+    dest: "{{ dynamic_data_store }}"
+  when: sensu_master
+  with_items:
+    - sensu_ca/cacert.pem
+    - server/cert.pem
+    - server/key.pem
+    - client/cert.pem
+    - client/key.pem

+ 2 - 2
vars/Amazon.yml

@@ -3,10 +3,10 @@
 # Defaults are defined in defaults/main.yml
 
 # Define repo url without $releasever
-#Define epel version to 6 by default, change to 7 when using a version 2 AMI
+# Define epel version to 6 by default, change to 7 when using a version 2 AMI
 epel_version: 6
 sensu_yum_repo_url: "https://sensu.global.ssl.fastly.net/yum/{{epel_version}}/$basearch/"
 
-#Set this to false to disable the EPEL repo installation
+# Set this to false to disable the EPEL repo installation
 enable_epel_repo: true
 epel_repo_rpm: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{epel_version}}.noarch.rpm"

+ 1 - 1
vars/CentOS.yml

@@ -2,5 +2,5 @@
 # vars/CentOS.yml: Variables for CentOS
 # Defaults are defined in defaults/main.yml
 
-#Set this to false to disable the EPEL repo installation
+# Set this to false to disable the EPEL repo installation
 enable_epel_repo: true

+ 1 - 1
vars/Fedora.yml

@@ -2,5 +2,5 @@
 # vars/Fedora.yml: Variables for Fedora
 # Defaults are defined in defaults/main.yml
 
-#RH/Centos 7 version works for Fedora 25 as a client
+# RH/Centos 7 version works for Fedora 25 as a client
 sensu_yum_repo_url: "https://sensu.global.ssl.fastly.net/yum/7/$basearch/"