Просмотр исходного кода

Didn't know 'include' with 'with_items' had been deprecated...

cmacrae 10 лет назад
Родитель
Сommit
30b0a781d0
6 измененных файлов с 30 добавлено и 24 удалено
  1. 5 4
      tasks/client.yml
  2. 5 4
      tasks/dashboard.yml
  3. 5 4
      tasks/main.yml
  4. 5 4
      tasks/rabbit.yml
  5. 5 4
      tasks/redis.yml
  6. 5 4
      tasks/server.yml

+ 5 - 4
tasks/client.yml

@@ -19,10 +19,11 @@
               src={{ sensu_client_config  }}
     notify: restart sensu-client service
 
-  - include: "{{ item }}"
-    with_first_found:
-      - "{{ ansible_distribution }}/client.yml"
-      - "{{ ansible_os_family }}/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
     service: name=sensu-client state=started enabled=yes

+ 5 - 4
tasks/dashboard.yml

@@ -1,9 +1,10 @@
 ---
 # tasks/dashboard.yml: Deployment of the Uchiwa dashboard
-  - include: "{{ item }}"
-    with_first_found:
-      - "{{ ansible_distribution }}/dashboard.yml"
-      - "{{ ansible_os_family }}/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
     service: name=uchiwa state=started enabled=yes

+ 5 - 4
tasks/main.yml

@@ -1,10 +1,11 @@
 ---
 # tasks/main.yml: "Master" playbook for the cmacrae.sensu role
 
-  - include: "{{ item }} tags=setup"
-    with_first_found:
-      - "{{ ansible_distribution }}/main.yml"
-      - "{{ ansible_os_family }}/main.yml"
+  - 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
 

+ 5 - 4
tasks/rabbit.yml

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

+ 5 - 4
tasks/redis.yml

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

+ 5 - 4
tasks/server.yml

@@ -12,10 +12,11 @@
               src=sensu-redis.json.j2
     notify: restart sensu-api service
 
-  - include: "{{ item }}"
-    with_first_found:
-      - "{{ ansible_distribution }}/server.yml"
-      - "{{ ansible_os_family }}/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
     service: name=sensu-server state=started enabled=yes