瀏覽代碼

No need to use explicit paths anymore!

cmacrae 9 年之前
父節點
當前提交
ef5a2eb248

+ 2 - 2
tasks/SmartOS/client.yml

@@ -2,12 +2,12 @@
 # tasks/SmartOS/client.yml: Deploy various client-side configurations for Sensu
 # Specific to Joyent SmartOS
   
-  - include_vars: ../../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: '../../templates/sensu-client.smartos_smf_manifest.xml.j2'
+      src: sensu-client.smartos_smf_manifest.xml.j2
       owner: root
       group: root
       mode: 644

+ 5 - 5
tasks/SmartOS/dashboard.yml

@@ -2,7 +2,7 @@
 # tasks/SmartOS/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to Joyent SmartOS
 
-  - include_vars: ../../vars/{{ ansible_distribution }}.yml
+  - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Ensure Uchiwa (dashboard) dependencies are installed
     pkgin: name=go state=present
@@ -58,7 +58,7 @@
 
   - name: Deploy Uchiwa config
     template:
-      src: '../../templates/uchiwa_config.json.j2'
+      src: uchiwa_config.json.j2
       dest: "{{ uchiwa_path }}/etc/config.json"
       owner: "{{ sensu_user_name }}"
       group: "{{ sensu_group_name }}"
@@ -66,17 +66,17 @@
 
   - name: Deploy Uchiwa service script
     template:
-      src: '../../templates/uchiwa.sh.j2'
+      src: uchiwa.sh.j2
       dest: /opt/local/lib/svc/method/uchiwa
       owner: root
       group: root
-      mode: 755
+      mode: 0755
     notify: restart uchiwa service
 
   - name: Deploy Uchiwa service manifest
     template:
       dest: /opt/local/lib/svc/manifest/uchiwa.xml
-      src: '../../templates/uchiwa.smartos_smf_manifest.xml.j2'
+      src: uchiwa.smartos_smf_manifest.xml.j2
       owner: root
       group: root
       mode: 644

+ 1 - 1
tasks/SmartOS/main.yml

@@ -2,7 +2,7 @@
 # tasks/SmartOS/main.yml: "Set-up" playbook for cmacrae.sensu role
 # This takes care of base prerequisites for Joyent SmartOS
 
-  - include_vars: ../../vars/{{ ansible_distribution }}.yml
+  - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Ensure the Sensu group is present
     group: name={{ sensu_group_name }} state=present

+ 1 - 1
tasks/SmartOS/redis.yml

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

+ 3 - 3
tasks/SmartOS/server.yml

@@ -3,12 +3,12 @@
 # a Sensu 'master' node.
 # Specific to SmartOS
 
-  - include_vars: ../../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: '../../templates/sensu-server.smartos_smf_manifest.xml.j2'
+      src: sensu-server.smartos_smf_manifest.xml.j2
       owner: root
       group: root
       mode: 644
@@ -17,7 +17,7 @@
   - name: Deploy Sensu API service manifest
     template:
       dest: /opt/local/lib/svc/manifest/sensu-api.xml
-      src: '../../templates/sensu-api.smartos_smf_manifest.xml.j2'
+      src: sensu-api.smartos_smf_manifest.xml.j2
       owner: root
       group: root
       mode: 644

+ 2 - 2
tasks/Ubuntu/dashboard.yml

@@ -2,7 +2,7 @@
 # tasks/Ubuntu/dashboard.yml: Deployment of the Uchiwa dashboard
 # Specific to Ubuntu
 
-  - include_vars: ../../vars/{{ ansible_distribution }}.yml
+  - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Retrieve the Uchiwa deb package
     get_url:
@@ -15,6 +15,6 @@
 
   - name: Deploy Uchiwa config
     template:
-      src: '../../templates/uchiwa_config.json.j2'
+      src: uchiwa_config.json.j2
       dest: "{{ sensu_config_path }}/uchiwa.json"
     notify: restart uchiwa service

+ 1 - 1
tasks/Ubuntu/main.yml

@@ -2,7 +2,7 @@
 # tasks/Ubuntu/main.yml: Ubuntu specific set-up
 # This takes care of base prerequisites for Ubuntu
 
-  - include_vars: ../../vars/{{ ansible_distribution }}.yml
+  - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Ensure the Sensu APT repo GPG key is present
     apt_key:

+ 1 - 1
tasks/Ubuntu/rabbit.yml

@@ -2,7 +2,7 @@
 # tasks/Ubuntu/rabbit.yml: Deploy RabbitMQ
 # Specific to Ubuntu
 
-  - include_vars: ../../vars/{{ ansible_distribution }}.yml
+  - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Ensure the RabbitMQ APT repo GPG key is present
     apt_key:

+ 2 - 2
tasks/Ubuntu/redis.yml

@@ -2,7 +2,7 @@
 # tasks/Ubuntu/redis.yml: Deploy Redis
 # Specific to Ubuntu
 
-  - include_vars: ../../vars/{{ ansible_distribution }}.yml
+  - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Ensure the Redis APT repo is present
     apt_repository:
@@ -18,5 +18,5 @@
 
   - name: Deploy Redis systemd service manifest
     copy:
-      src: '../../files/ubuntu_redis_systemd.service'
+      src: ubuntu_redis_systemd.service
       dest: /etc/systemd/system/redis.service

+ 1 - 1
tasks/plugins.yml

@@ -15,7 +15,7 @@
   - name: Register available checks
     local_action: command ls {{ static_data_store }}/sensu/checks
     register: sensu_available_checks
-    changed_when: False
+    changed_when: false
 
   - name: Deploy check plugins
     copy:

+ 4 - 0
tasks/rabbit.yml

@@ -20,6 +20,10 @@
       - "{{ sensu_ssl_server_cacert }}"
       - "{{ sensu_ssl_server_cert }}"
       - "{{ sensu_ssl_server_key }}"
+    notify:
+      - restart rabbitmq service
+      - restart sensu-api service
+      - restart sensu-server service
 
   - name: Deploy RabbitMQ config
     template:

+ 1 - 0
tasks/ssl.yml

@@ -17,3 +17,4 @@
     with_items:
       - "{{ sensu_ssl_client_cert }}"
       - "{{ sensu_ssl_client_key }}"
+    notify: restart sensu-client service