Parcourir la source

Make cmacrae.sensu to comply with ansible-lint. (#22)

- Clean up whitespace
- Use `unarchive` instead  of `shell`
- Use octal file permissions

* Octal file permissions must contain leading zero and trailing whitespaces removed

* change shell: tar into unarchive
Juha Ylitalo il y a 9 ans
Parent
commit
6f50ceb578

+ 4 - 4
handlers/main.yml

@@ -2,7 +2,7 @@
 
   - name: restart rabbitmq service
     service: name={{ rabbitmq_service_name }} state=restarted
-  
+
   - name: restart redis service
     service: name={{ redis_service_name }} state=restarted
 
@@ -23,13 +23,13 @@
   # 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-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
 

+ 1 - 1
meta/main.yml

@@ -110,7 +110,7 @@ galaxy_info:
   #  - lenny
   #  - squeeze
   #  - wheezy
-  
+
   galaxy_tags:
     - cloud
     - monitoring

+ 2 - 2
tasks/SmartOS/client.yml

@@ -1,7 +1,7 @@
 ---
 # tasks/SmartOS/client.yml: Deploy various client-side configurations for Sensu
 # Specific to Joyent SmartOS
-  
+
   - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Deploy Sensu client service manifest
@@ -10,7 +10,7 @@
       src: sensu-client.smartos_smf_manifest.xml.j2
       owner: root
       group: root
-      mode: 644
+      mode: 0644
     notify:
       - import sensu-client service
       - restart sensu-client service

+ 3 - 3
tasks/SmartOS/server.yml

@@ -11,7 +11,7 @@
       src: sensu-server.smartos_smf_manifest.xml.j2
       owner: root
       group: root
-      mode: 644
+      mode: 0644
     notify: import sensu-server service
 
   - name: Deploy Sensu API service manifest
@@ -20,7 +20,7 @@
       src: sensu-api.smartos_smf_manifest.xml.j2
       owner: root
       group: root
-      mode: 644
+      mode: 0644
     notify: import sensu-api service
- 
+
   - meta: flush_handlers

+ 1 - 1
tasks/client.yml

@@ -1,6 +1,6 @@
 ---
 # tasks/client.yml: Deploy various client-side configurations for Sensu
-  
+
   - include_vars: "{{ ansible_distribution }}.yml"
 
   - name: Ensure the Sensu config directory is present

+ 2 - 2
tasks/main.yml

@@ -5,7 +5,7 @@
 
   - include: "{{ ansible_distribution }}/main.yml"
     tags: setup
-      
+
   - include: redis.yml
     tags: redis
     when: redis_server
@@ -26,7 +26,7 @@
   - include: dashboard.yml
     tags: dashboard
     when: sensu_include_dashboard
-    
+
   - include: client.yml
     tags: client
 

+ 1 - 1
tasks/plugins.yml

@@ -70,6 +70,6 @@
     when: sensu_master
     with_fileglob:
       - "{{ static_data_store }}/sensu/definitions/*"
-    notify: 
+    notify:
       - restart sensu-server service
       - restart sensu-api service

+ 1 - 1
tasks/rabbit.yml

@@ -25,7 +25,7 @@
       src: "{{ rabbitmq_config_template }}"
       owner: root
       group: "{{ __root_group }}"
-      mode: 644
+      mode: 0644
     notify: restart rabbitmq service
 
   - name: Ensure RabbitMQ is running

+ 3 - 2
tasks/ssl_generate.yml

@@ -27,9 +27,10 @@
         dest: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool.tar"
 
     - name: Untar the ssl_certs tarball from sensuapp.org
-      shell: tar xf sensu_ssl_tool.tar
+      unarchive:
       args:
-        chdir: "{{ sensu_config_path }}/ssl_generation"
+        src: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool.tar"
+        dest: "{{ sensu_config_path }}/ssl_generation/"
         creates: "{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool"
 
     - name: Generate SSL certs