Browse Source

Aaaand I forgot why I did that in the first place:

'include' doesn't expect variables :/
cmacrae 10 năm trước cách đây
mục cha
commit
e64e9efce2

+ 5 - 1
tasks/client.yml

@@ -19,7 +19,11 @@
               src={{ sensu_client_config  }}
               src={{ sensu_client_config  }}
     notify: restart sensu-client service
     notify: restart sensu-client service
 
 
-  - include: "{{ ansible_distribution }}/client.yml"
+  - include: SmartOS/client.yml
+    when: ansible_distribution == SmartOS
+
+  - include: Ubuntu/client.yml
+    when: ansible_distribution == Ubuntu
 
 
   - name: Ensure Sensu client service is running
   - name: Ensure Sensu client service is running
     service: name=sensu-client state=started enabled=yes
     service: name=sensu-client state=started enabled=yes

+ 5 - 1
tasks/dashboard.yml

@@ -1,6 +1,10 @@
 ---
 ---
 # tasks/dashboard.yml: Deployment of the Uchiwa dashboard
 # tasks/dashboard.yml: Deployment of the Uchiwa dashboard
-  - include: "{{ ansible_distribution }}/dashboard.yml"
+  - include: SmartOS/dashboard.yml
+    when: ansible_distribution == SmartOS
+
+  - include: Ubuntu/dashboard.yml
+    when: ansible_distribution == Ubuntu
 
 
   - name: Ensure Uchiwa server service is running
   - name: Ensure Uchiwa server service is running
     service: name=uchiwa state=started enabled=yes
     service: name=uchiwa state=started enabled=yes

+ 5 - 1
tasks/main.yml

@@ -1,7 +1,11 @@
 ---
 ---
 # tasks/main.yml: "Master" playbook for the cmacrae.sensu role
 # tasks/main.yml: "Master" playbook for the cmacrae.sensu role
 
 
-  - include: "{{ ansible_distribution }}/main.yml tags=setup"
+  - include: SmartOS/main.yml tags=setup
+    when: ansible_distribution == SmartOS
+
+  - include: Ubuntu/main.yml tags=setup
+    when: ansible_distribution == Ubuntu
       
       
   - include: ssl.yml tags=ssl
   - include: ssl.yml tags=ssl
 
 

+ 5 - 1
tasks/rabbit.yml

@@ -7,7 +7,11 @@
       - "{{ ansible_os_family }}.yml"
       - "{{ ansible_os_family }}.yml"
       - default.yml
       - default.yml
 
 
-  - include: "{{ ansible_distribution }}/rabbit.yml"
+  - include: SmartOS/rabbit.yml
+    when: ansible_distribution == SmartOS
+
+  - include: Ubuntu/rabbit.yml
+    when: ansible_distribution == Ubuntu
 
 
   - name: Ensure RabbitMQ SSL directory exists
   - name: Ensure RabbitMQ SSL directory exists
     file: dest={{ rabbitmq_config_path }}/ssl state=directory
     file: dest={{ rabbitmq_config_path }}/ssl state=directory

+ 5 - 1
tasks/redis.yml

@@ -1,7 +1,11 @@
 ---
 ---
 # tasks/redis.yml: Deploy Redis
 # tasks/redis.yml: Deploy Redis
 
 
-  - include: "{{ ansible_distribution }}/redis.yml"
+  - include: SmartOS/redis.yml
+    when: ansible_distribution == SmartOS
+
+  - include: Ubuntu/redis.yml
+    when: ansible_distribution == Ubuntu
 
 
   - name: Ensure Redis is running
   - name: Ensure Redis is running
     service: name=redis state=started enabled=true
     service: name=redis state=started enabled=true

+ 5 - 1
tasks/server.yml

@@ -12,7 +12,11 @@
               src=sensu-redis.json.j2
               src=sensu-redis.json.j2
     notify: restart sensu-api service
     notify: restart sensu-api service
 
 
-  - include: "{{ ansible_distribution }}/server.yml"
+  - include: SmartOS/server.yml
+    when: ansible_distribution == SmartOS
+
+  - include: Ubuntu/server.yml
+    when: ansible_distribution == Ubuntu
 
 
   - name: Ensure Sensu server service is running
   - name: Ensure Sensu server service is running
     service: name=sensu-server state=started enabled=yes
     service: name=sensu-server state=started enabled=yes