Ver código fonte

chore(cleanup) for Ansible 2.7

The following notices every run on Ansble 2.7, perhaps eralier and tags would not run anything.

- The use of 'static' has been deprecated.
- Use 'import_tasks' for static inclusion, or 'include_tasks' for dynamic inclusion.

```bash
ansible-playbook sensu.yml --tags plugins
ansible-playbook sensu.yml --tags client,server
ansible-playbook sensu.yml --tags ssl
```

setup tag still does not work due to issues with include_tasks

```bash
ansible-playbook sensu.yml --tags setup
```
Michael Porter 7 anos atrás
pai
commit
fa4ff71a8d
7 arquivos alterados com 15 adições e 23 exclusões
  1. 1 2
      tasks/client.yml
  2. 1 1
      tasks/dashboard.yml
  3. 9 14
      tasks/main.yml
  4. 1 1
      tasks/rabbit.yml
  5. 1 1
      tasks/redis.yml
  6. 1 2
      tasks/server.yml
  7. 1 2
      tasks/ssl.yml

+ 1 - 2
tasks/client.yml

@@ -12,9 +12,8 @@
     mode: "0640"
   notify: restart sensu-client service
 
-- include: "{{ role_path }}/tasks/SmartOS/client.yml"
+- include_tasks: "{{ role_path }}/tasks/SmartOS/client.yml"
   when: ansible_distribution == "SmartOS"
-  static: false
 
 - name: Ensure Sensu client service is running
   service:

+ 1 - 1
tasks/dashboard.yml

@@ -1,6 +1,6 @@
 ---
 # tasks/dashboard.yml: Deployment of the Uchiwa dashboard
-- include: "{{ role_path }}/tasks/{{ ansible_distribution }}/dashboard.yml"
+- include_tasks: "{{ role_path }}/tasks/{{ ansible_distribution }}/dashboard.yml"
 
 - name: Ensure Uchiwa/Sensu Enterprise Dashboard server service is running
   service:

+ 9 - 14
tasks/main.yml

@@ -4,46 +4,41 @@
 - name: Include distribution specific variables
   include_vars: "{{ ansible_distribution }}.yml"
 
-- include: "{{ role_path }}/tasks/{{ ansible_distribution }}/main.yml"
+- include_tasks: "{{ role_path }}/tasks/{{ ansible_distribution }}/main.yml"
   tags: setup
   when: sensu_master
         or sensu_client
 
-- include: "{{ role_path }}/tasks/redis.yml"
+- import_tasks: "redis.yml"
   tags: redis
   when: redis_server
         and sensu_deploy_redis_server
-  static: false
 
-- include: "{{ role_path }}/tasks/ssl.yml"
+- import_tasks: "ssl.yml"
   tags: ssl
 
-- include: "{{ role_path }}/tasks/rabbit.yml"
+- import_tasks: "rabbit.yml"
   tags: rabbitmq
   when: rabbitmq_server
         and sensu_deploy_rabbitmq_server
-  static: false
 
-- include: "{{ role_path }}/tasks/common.yml"
+- import_tasks: "common.yml"
   tags: common
   when: sensu_master
         or sensu_client
 
-- include: "{{ role_path }}/tasks/server.yml"
+- import_tasks: "server.yml"
   tags: server
   when: sensu_master
-  static: false
 
-- include: "{{ role_path }}/tasks/dashboard.yml"
+- import_tasks: "dashboard.yml"
   tags: dashboard
   when: sensu_include_dashboard
-  static: false
 
-- include: "{{ role_path }}/tasks/client.yml"
+- import_tasks: "client.yml"
   tags: client
   when: sensu_client
 
-- include: "{{ role_path }}/tasks/plugins.yml"
+- import_tasks: "plugins.yml"
   tags: plugins
   when: sensu_include_plugins
-  static: false

+ 1 - 1
tasks/rabbit.yml

@@ -3,7 +3,7 @@
 
 - include_vars: "{{ ansible_distribution }}.yml"
 
-- include: "{{ ansible_distribution }}/rabbit.yml"
+- include_tasks: "{{ ansible_distribution }}/rabbit.yml"
 
 - name: Ensure RabbitMQ SSL directory exists
   file:

+ 1 - 1
tasks/redis.yml

@@ -1,7 +1,7 @@
 ---
 # tasks/redis.yml: Deploy redis
 
-- include: "{{ role_path }}/tasks/{{ ansible_distribution }}/redis.yml"
+- include_tasks: "{{ role_path }}/tasks/{{ ansible_distribution }}/redis.yml"
 
 - name: Ensure redis is running
   service:

+ 1 - 2
tasks/server.yml

@@ -19,9 +19,8 @@
     src: sensu-tessen.json.j2
   notify: restart sensu-server service
 
-- include: "{{ role_path }}/tasks/SmartOS/server.yml"
+- include_tasks: "{{ role_path }}/tasks/SmartOS/server.yml"
   when: ansible_distribution == "SmartOS"
-  static: false
 
 - name: Ensure Sensu server service is running
   service:

+ 1 - 2
tasks/ssl.yml

@@ -11,9 +11,8 @@
     group: "{{ sensu_group_name }}"
   when: sensu_ssl_manage_certs
 
-- include: "{{ role_path }}/tasks/ssl_generate.yml"
+- include_tasks: "{{ role_path }}/tasks/ssl_generate.yml"
   when: sensu_ssl_gen_certs
-  static: false
 
 - name: Deploy the Sensu client SSL cert/key
   copy: