You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/03/26 11:57:17 UTC

[GitHub] rabbah closed pull request #3457: Ansible 2.4 deprecates ���include��� in favor of ���import_*��� and ���include_tasks���

rabbah closed pull request #3457: Ansible 2.4 deprecates ‘include’ in favor of ‘import_*’ and ‘include_tasks’
URL: https://github.com/apache/incubator-openwhisk/pull/3457
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ansible/initdb.yml b/ansible/initdb.yml
index 9579f7927d..e14aac32a7 100644
--- a/ansible/initdb.yml
+++ b/ansible/initdb.yml
@@ -4,4 +4,4 @@
 
 - hosts: ansible
   tasks:
-  - include: tasks/initdb.yml
+  - include_tasks: tasks/initdb.yml
diff --git a/ansible/logs.yml b/ansible/logs.yml
index 545e69b172..67066e6d0a 100644
--- a/ansible/logs.yml
+++ b/ansible/logs.yml
@@ -1,7 +1,7 @@
 ---
 # This playbook is used for utilities around logs
 
-- include: properties.yml
+- import_playbook: properties.yml
 
 - hosts: ansible
   tasks:
diff --git a/ansible/openwhisk.yml b/ansible/openwhisk.yml
index 58263b6389..e5dc7d59e4 100644
--- a/ansible/openwhisk.yml
+++ b/ansible/openwhisk.yml
@@ -3,12 +3,12 @@
 # It assumes you have already set up your database with the respective db provider playbook (currently cloudant.yml or couchdb.yml)
 # It assumes that wipe.yml have being deployed at least once
 
-- include: kafka.yml
+- import_playbook: kafka.yml
 
-- include: controller.yml
+- import_playbook: controller.yml
 
-- include: invoker.yml
+- import_playbook: invoker.yml
 
-- include: edge.yml
+- import_playbook: edge.yml
 
-- include: routemgmt.yml
+- import_playbook: routemgmt.yml
diff --git a/ansible/postdeploy.yml b/ansible/postdeploy.yml
index 099c3a0e10..4bbb1ea567 100644
--- a/ansible/postdeploy.yml
+++ b/ansible/postdeploy.yml
@@ -1,10 +1,10 @@
 ---
 # This playbook installs additional packages after whisk has been deployed.
 
-- include: properties.yml
+- import_playbook: properties.yml
 
 - hosts: ansible
   tasks:
-    - include: tasks/installOpenwhiskCatalog.yml
+    - include_tasks: tasks/installOpenwhiskCatalog.yml
       when: (mode == "deploy")
-      with_dict: "{{ catalog_repos }}"
\ No newline at end of file
+      with_dict: "{{ catalog_repos }}"
diff --git a/ansible/properties.yml b/ansible/properties.yml
index 7c0acd183c..014a99a9ab 100644
--- a/ansible/properties.yml
+++ b/ansible/properties.yml
@@ -3,5 +3,5 @@
 
 - hosts: ansible
   tasks:
-    - include: tasks/writeWhiskProperties.yml
+    - import_tasks: tasks/writeWhiskProperties.yml
       when: mode == "deploy"
diff --git a/ansible/provision_env_dist.yml b/ansible/provision_env_dist.yml
index 6f4284571c..9a74dbd1b3 100644
--- a/ansible/provision_env_dist.yml
+++ b/ansible/provision_env_dist.yml
@@ -9,7 +9,7 @@
         dest: "{{hosts_dir}}/hosts"
 
     - name: Create instances
-      include: boot_instances_dist.yml instance={{item}}
+      import_tasks: boot_instances_dist.yml instance={{item}}
       with_items: instances
 
     - meta: refresh_inventory
diff --git a/ansible/recreateDesignDocs.yml b/ansible/recreateDesignDocs.yml
index a5a3017481..52c8b44ebc 100644
--- a/ansible/recreateDesignDocs.yml
+++ b/ansible/recreateDesignDocs.yml
@@ -3,5 +3,5 @@
 
 - hosts: ansible
   tasks:
-    - include: tasks/recreateViews.yml
+    - import_tasks: tasks/recreateViews.yml
       when: mode == "deploy"
diff --git a/ansible/registry.yml b/ansible/registry.yml
index f58d379eed..4c015d0586 100644
--- a/ansible/registry.yml
+++ b/ansible/registry.yml
@@ -4,7 +4,7 @@
 # Generate cert if needed. Not used currently.
 - hosts: ansible
   tasks:
-  - include: roles/registry/tasks/gencert.yml
+  - import_tasks: roles/registry/tasks/gencert.yml
     when: mode == "deploy" and registry.gencert == true
 
 # Deploy registry
@@ -16,5 +16,5 @@
 - hosts: all:!ansible
   become: true
   tasks:
-  - include: roles/registry/tasks/publish.yml
+  - import_tasks: roles/registry/tasks/publish.yml
     when: mode == "deploy" and registry.gencert
diff --git a/ansible/roles/apigateway/tasks/main.yml b/ansible/roles/apigateway/tasks/main.yml
index bfddaecdf0..7092708eee 100644
--- a/ansible/roles/apigateway/tasks/main.yml
+++ b/ansible/roles/apigateway/tasks/main.yml
@@ -3,9 +3,9 @@
 # In deploy mode it will deploy apigateway.
 # In clean mode it will remove the apigateway containers.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
 
diff --git a/ansible/roles/cli-install/tasks/main.yml b/ansible/roles/cli-install/tasks/main.yml
index b03b406c3a..94bfb78fd8 100644
--- a/ansible/roles/cli-install/tasks/main.yml
+++ b/ansible/roles/cli-install/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will generate a new CLI config, generate a tarball and copy it to nginx.
 # In clean mode it will clean the cli.nginxdir
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/cli/tasks/main.yml b/ansible/roles/cli/tasks/main.yml
index b03b406c3a..94bfb78fd8 100644
--- a/ansible/roles/cli/tasks/main.yml
+++ b/ansible/roles/cli/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will generate a new CLI config, generate a tarball and copy it to nginx.
 # In clean mode it will clean the cli.nginxdir
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/controller/tasks/deploy.yml b/ansible/roles/controller/tasks/deploy.yml
index a02cf79592..b9e8c788d2 100644
--- a/ansible/roles/controller/tasks/deploy.yml
+++ b/ansible/roles/controller/tasks/deploy.yml
@@ -1,7 +1,7 @@
 ---
 # This role will install Controller in group 'controllers' in the environment inventory
 
-- include: docker_login.yml
+- import_tasks: docker_login.yml
 
 - name: get controller index
   set_fact:
@@ -71,7 +71,7 @@
   become: "{{ controller.dir.become }}"
 
 - name: check, that required databases exist
-  include: "{{ openwhisk_home }}/ansible/tasks/db/checkDb.yml"
+  include_tasks: "{{ openwhisk_home }}/ansible/tasks/db/checkDb.yml"
   vars:
     dbName: "{{ item }}"
   with_items:
diff --git a/ansible/roles/controller/tasks/main.yml b/ansible/roles/controller/tasks/main.yml
index 388d45890c..a3ed3e9102 100644
--- a/ansible/roles/controller/tasks/main.yml
+++ b/ansible/roles/controller/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will deploy controllers.
 # In clean mode it will remove the controller containers.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
\ No newline at end of file
diff --git a/ansible/roles/couchdb/tasks/main.yml b/ansible/roles/couchdb/tasks/main.yml
index 0eb6ea65df..fddf1f9279 100644
--- a/ansible/roles/couchdb/tasks/main.yml
+++ b/ansible/roles/couchdb/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will start the CouchDB container.
 # In clean mode it will remove the CouchDB container.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml
index 668db115fe..8b492a2371 100644
--- a/ansible/roles/docker/tasks/main.yml
+++ b/ansible/roles/docker/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will install docker using apt.
 # In clean mode it will uninstall docker.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/invoker/tasks/deploy.yml b/ansible/roles/invoker/tasks/deploy.yml
index 51867f4d11..e9302eb087 100644
--- a/ansible/roles/invoker/tasks/deploy.yml
+++ b/ansible/roles/invoker/tasks/deploy.yml
@@ -1,7 +1,7 @@
 ---
 # This role installs invokers.
 
-- include: docker_login.yml
+- import_tasks: docker_login.yml
 
 - name: "pull invoker image with tag {{docker.image.tag}}"
   shell: "docker pull {{docker_registry}}{{item}}:{{docker.image.tag}}"
@@ -67,7 +67,7 @@
     dest: "{{ invoker.confdir }}/invoker{{ groups['invokers'].index(inventory_hostname) }}"
 
 - name: check, that required databases exist
-  include: "{{ openwhisk_home }}/ansible/tasks/db/checkDb.yml"
+  include_tasks: "{{ openwhisk_home }}/ansible/tasks/db/checkDb.yml"
   vars:
     dbName: "{{ item }}"
   with_items:
diff --git a/ansible/roles/invoker/tasks/main.yml b/ansible/roles/invoker/tasks/main.yml
index 32ed7cd404..b9d02ca771 100644
--- a/ansible/roles/invoker/tasks/main.yml
+++ b/ansible/roles/invoker/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will deploy invokers.
 # In clean mode it will remove the invoker containers.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
\ No newline at end of file
diff --git a/ansible/roles/kafka/tasks/main.yml b/ansible/roles/kafka/tasks/main.yml
index 0140e39bf2..5b3f11910e 100644
--- a/ansible/roles/kafka/tasks/main.yml
+++ b/ansible/roles/kafka/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will deploy kafka including zookeeper.
 # In clean mode it will remove kafka and zookeeper containers.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
\ No newline at end of file
diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml
index d1f78af0b4..81e9f4a3b2 100644
--- a/ansible/roles/nginx/tasks/main.yml
+++ b/ansible/roles/nginx/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will deploy an nginx server.
 # In clean mode it will remove the nginx server as well as nginx.confdir
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/prereq/tasks/main.yml b/ansible/roles/prereq/tasks/main.yml
index 3721a811f8..cee6ab0a7a 100644
--- a/ansible/roles/prereq/tasks/main.yml
+++ b/ansible/roles/prereq/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will install all necessary packages and programs.
 # In clean mode it will uninstall packages from deploy mode.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/redis/tasks/main.yml b/ansible/roles/redis/tasks/main.yml
index 226e89c82c..b0bef6555b 100644
--- a/ansible/roles/redis/tasks/main.yml
+++ b/ansible/roles/redis/tasks/main.yml
@@ -3,9 +3,9 @@
 # In deploy mode it will deploy redis.
 # In clean mode it will remove the redis containers.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
 
diff --git a/ansible/roles/registry/tasks/main.yml b/ansible/roles/registry/tasks/main.yml
index e4de59c4d0..b6bacd179f 100644
--- a/ansible/roles/registry/tasks/main.yml
+++ b/ansible/roles/registry/tasks/main.yml
@@ -4,8 +4,8 @@
 # Recycling means retaining the last few images of all repos and importing them into the new instance.
 # In clean mode it will remove the registry, deleting all images.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
\ No newline at end of file
diff --git a/ansible/roles/routemgmt/tasks/main.yml b/ansible/roles/routemgmt/tasks/main.yml
index 3f5bece2a9..42edb08321 100644
--- a/ansible/roles/routemgmt/tasks/main.yml
+++ b/ansible/roles/routemgmt/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will deploy the API Gateway route management actions.
 # In clean mode it will remove the API Gateway route management actions.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/whiskhost/tasks/deploy.yml b/ansible/roles/whiskhost/tasks/deploy.yml
index 624ab3377b..998962873b 100644
--- a/ansible/roles/whiskhost/tasks/deploy.yml
+++ b/ansible/roles/whiskhost/tasks/deploy.yml
@@ -1,7 +1,7 @@
 ---
 # Add user and patch kernel.
 
-- include: addUser.yml
+- import_tasks: addUser.yml
   when: docker.user is defined
 
-- include: patchKernel.yml
+- import_tasks: patchKernel.yml
diff --git a/ansible/roles/whiskhost/tasks/main.yml b/ansible/roles/whiskhost/tasks/main.yml
index b0d2f941db..457cb8b30a 100644
--- a/ansible/roles/whiskhost/tasks/main.yml
+++ b/ansible/roles/whiskhost/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will patch the system with the right kernel.
 # In clean mode it will do nothing atm.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
diff --git a/ansible/roles/zookeeper/tasks/main.yml b/ansible/roles/zookeeper/tasks/main.yml
index 0140e39bf2..5b3f11910e 100644
--- a/ansible/roles/zookeeper/tasks/main.yml
+++ b/ansible/roles/zookeeper/tasks/main.yml
@@ -3,8 +3,8 @@
 # In deploy mode it will deploy kafka including zookeeper.
 # In clean mode it will remove kafka and zookeeper containers.
 
-- include: deploy.yml
+- import_tasks: deploy.yml
   when: mode == "deploy"
 
-- include: clean.yml
+- import_tasks: clean.yml
   when: mode == "clean"
\ No newline at end of file
diff --git a/ansible/routemgmt.yml b/ansible/routemgmt.yml
index 1807328b13..db72a814bc 100644
--- a/ansible/routemgmt.yml
+++ b/ansible/routemgmt.yml
@@ -1,7 +1,7 @@
 ---
 # This playbook deploys the Openwhisk API Gateway route management actions.
 
-- include: properties.yml
+- import_playbook: properties.yml
 
 - hosts: ansible
   roles:
diff --git a/ansible/tasks/initdb.yml b/ansible/tasks/initdb.yml
index 5a8665a187..93ee6cf9c4 100644
--- a/ansible/tasks/initdb.yml
+++ b/ansible/tasks/initdb.yml
@@ -2,12 +2,12 @@
 # This task will initialize the immortal DBs in the database account.
 # This step is usually done only once per deployment.
 
-- include: db/recreateDb.yml
+- include_tasks: db/recreateDb.yml
   vars:
     dbName: "{{ db.whisk.auth }}"
     forceRecreation: False
 
-- include: db/recreateDoc.yml
+- include_tasks: db/recreateDoc.yml
   vars:
     dbName: "{{ db.whisk.auth }}"
     doc: "{{ lookup('file', '{{ item }}') }}"
@@ -17,7 +17,7 @@
     - "{{ openwhisk_home }}/ansible/files/namespace_throttlings_design_document_for_subjects_db.json"
 
 - name: create necessary "auth" keys
-  include: db/recreateDoc.yml
+  include_tasks: db/recreateDoc.yml
   vars:
     key: "{{ lookup('file', 'files/auth.{{ item }}') }}"
     dbName: "{{ db.whisk.auth }}"
diff --git a/ansible/tasks/recreateViews.yml b/ansible/tasks/recreateViews.yml
index d237da7974..5ee657e1dd 100644
--- a/ansible/tasks/recreateViews.yml
+++ b/ansible/tasks/recreateViews.yml
@@ -1,7 +1,7 @@
 ---
 # Recreates all views in all databases.
 
-- include: db/recreateDoc.yml
+- include_tasks: db/recreateDoc.yml
   vars:
     dbName: "{{ db.whisk.actions }}"
     doc: "{{ lookup('file', '{{ item }}') }}"
@@ -9,7 +9,7 @@
     - "{{ openwhisk_home }}/ansible/files/whisks_design_document_for_entities_db_v2.1.0.json"
     - "{{ openwhisk_home }}/ansible/files/filter_design_document.json"
 
-- include: db/recreateDoc.yml
+- include_tasks: db/recreateDoc.yml
   vars:
     dbName: "{{ db.whisk.activations }}"
     doc: "{{ lookup('file', '{{ item }}') }}"
diff --git a/ansible/tasks/wipeDatabase.yml b/ansible/tasks/wipeDatabase.yml
index b95f7fb843..dde9fa05f1 100644
--- a/ansible/tasks/wipeDatabase.yml
+++ b/ansible/tasks/wipeDatabase.yml
@@ -2,15 +2,15 @@
 # Wipe transient databases. You should know what you are doing here.
 # withViews: True or False. Says, if the views have to be recreated.
 
-- include: db/recreateDb.yml
+- include_tasks: db/recreateDb.yml
   vars:
     dbName: "{{ db.whisk.actions }}"
     forceRecreation: True
-- include: db/recreateDb.yml
+- include_tasks: db/recreateDb.yml
   vars:
     dbName: "{{ db.whisk.activations }}"
     forceRecreation: True
   when: db.whisk.activations != db.whisk.actions
 
-- include: recreateViews.yml
+- include_tasks: recreateViews.yml
   when: withViews == True
diff --git a/ansible/wipe.yml b/ansible/wipe.yml
index edda64ad94..c8603b72f1 100644
--- a/ansible/wipe.yml
+++ b/ansible/wipe.yml
@@ -3,7 +3,7 @@
 
 - hosts: ansible
   tasks:
-    - include: tasks/wipeDatabase.yml
+    - import_tasks: tasks/wipeDatabase.yml
       vars:
         withViews: True
       when: mode == "deploy"


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services