Jelajahi Sumber

Convert node-related roles from include_tasks to import_tasks

This commit moves as much as feasible to import_tasks
to create as many static imports as possible.
Michael Gugino 7 tahun lalu
induk
melakukan
186b2eee8b

+ 2 - 2
roles/container_runtime/tasks/common/post.yml

@@ -13,14 +13,14 @@
 # This needs to run after docker is restarted to account for proxy settings.
 # registry_auth is called directly with import_role in some places, so we
 # have to put it in the root of the tasks/ directory.
-- include_tasks: ../registry_auth.yml
+- import_tasks: ../registry_auth.yml
 
 - name: stat the docker data dir
   stat:
     path: "{{ docker_default_storage_path }}"
   register: dockerstat
 
-- include_tasks: setup_docker_symlink.yml
+- import_tasks: setup_docker_symlink.yml
   when:
     - openshift_use_crio | bool
     - dockerstat.stat.islnk is defined and not (dockerstat.stat.islnk | bool)

+ 1 - 1
roles/container_runtime/tasks/common/pre.yml

@@ -1,5 +1,5 @@
 ---
-- include_tasks: udev_workaround.yml
+- import_tasks: udev_workaround.yml
   when: docker_udev_workaround | default(False) | bool
 
 - name: Add enterprise registry, if necessary

+ 2 - 2
roles/container_runtime/tasks/package_crio.yml

@@ -4,7 +4,7 @@
   when:
     - openshift_is_atomic | bool
 
-- include_tasks: common/pre.yml
+- import_tasks: common/pre.yml
 
 - name: Check that overlay is in the kernel
   shell: lsmod | grep overlay
@@ -84,6 +84,6 @@
 
 # If we are using crio only, docker.service might not be available for
 # 'docker login'
-- include_tasks: common/post.yml
+- import_tasks: common/post.yml
   vars:
     openshift_docker_alternative_creds: "{{ (openshift_use_crio_only | bool) or (openshift_docker_use_system_container | bool) }}"

+ 4 - 4
roles/container_runtime/tasks/package_docker.yml

@@ -1,9 +1,9 @@
 ---
-- include_tasks: common/pre.yml
+- import_tasks: common/pre.yml
 
 # In some cases, some services may be run as containers and docker may still
 # be installed via rpm.
-- include_tasks: common/atomic_proxy.yml
+- import_tasks: common/atomic_proxy.yml
   when:
   - >
     (openshift_use_system_containers | default(False)) | bool
@@ -20,7 +20,7 @@
   changed_when: false
 
 # Some basic checks to ensure the role will complete
-- include_tasks: docker_sanity.yml
+- import_tasks: docker_sanity.yml
 
 # Make sure Docker is installed, but does not update a running version.
 # Docker upgrades are handled by a separate playbook.
@@ -157,4 +157,4 @@
 - set_fact:
     docker_service_status_changed: "{{ (r_docker_package_docker_start_result is changed) and (r_docker_already_running_result.stdout != 'ActiveState=active' ) }}"
 
-- include_tasks: common/post.yml
+- import_tasks: common/post.yml

+ 4 - 4
roles/container_runtime/tasks/systemcontainer_crio.yml

@@ -6,9 +6,9 @@
     - openshift_is_containerized | bool
     - not l_is_node_system_container | bool
 
-- include_tasks: common/pre.yml
+- import_tasks: common/pre.yml
 
-- include_tasks: common/syscontainer_packages.yml
+- import_tasks: common/syscontainer_packages.yml
 
 - name: Check that overlay is in the kernel
   shell: lsmod | grep overlay
@@ -35,7 +35,7 @@
         state: restarted
 
 - name: Ensure proxies are in the atomic.conf
-  include_tasks: common/atomic_proxy.yml
+  import_tasks: common/atomic_proxy.yml
 
 # Be nice and let the user see the variable result
 - debug:
@@ -110,6 +110,6 @@
 
 # If we are using crio only, docker.service might not be available for
 # 'docker login'
-- include_tasks: common/post.yml
+- import_tasks: common/post.yml
   vars:
     openshift_docker_alternative_creds: "{{ (openshift_use_crio_only | bool) or (openshift_docker_use_system_container | bool) }}"

+ 5 - 5
roles/container_runtime/tasks/systemcontainer_docker.yml

@@ -11,9 +11,9 @@
       traditional docker package install. Otherwise, comment out openshift_docker_options
       in your inventory file.
 
-- include_tasks: common/pre.yml
+- import_tasks: common/pre.yml
 
-- include_tasks: common/syscontainer_packages.yml
+- import_tasks: common/syscontainer_packages.yml
 
 # Make sure Docker is installed so we are able to use the client
 - name: Install Docker so we can use the client
@@ -37,7 +37,7 @@
   delay: 30
 
 - name: Ensure proxies are in the atomic.conf
-  include_tasks: common/atomic_proxy.yml
+  import_tasks: common/atomic_proxy.yml
 
 # Be nice and let the user see the variable result
 - debug:
@@ -45,7 +45,7 @@
 
 # Do the authentication before pulling the container engine system container
 # as the pull might be from an authenticated registry.
-- include_tasks: registry_auth.yml
+- import_tasks: registry_auth.yml
   vars:
     openshift_docker_alternative_creds: True
 
@@ -105,6 +105,6 @@
 
 # Since docker is running as a system container, docker login will fail to create
 # credentials.  Use alternate method if requiring authenticated registries.
-- include_tasks: common/post.yml
+- import_tasks: common/post.yml
   vars:
     openshift_docker_alternative_creds: True

+ 5 - 5
roles/openshift_excluder/tasks/disable.yml

@@ -2,11 +2,11 @@
 - when: r_openshift_excluder_verify_upgrade
   block:
   - name: Include verify_upgrade.yml when upgrading
-    include_tasks: verify_upgrade.yml
+    import_tasks: verify_upgrade.yml
 
 # unexclude the current openshift/origin-excluder if it is installed so it can be updated
 - name: Disable excluders before the upgrade to remove older excluding expressions
-  include_tasks: unexclude.yml
+  import_tasks: unexclude.yml
   vars:
     # before the docker excluder can be updated, it needs to be disabled
     # to remove older excluded packages that are no longer excluded
@@ -15,12 +15,12 @@
 
 # Install any excluder that is enabled
 - name: Include install.yml
-  include_tasks: install.yml
+  import_tasks: install.yml
 
 # And finally adjust an excluder in order to update host components correctly. First
 # exclude then unexclude
 - name: Include exclude.yml
-  include_tasks: exclude.yml
+  import_tasks: exclude.yml
   vars:
     # Enable the docker excluder only if it is overridden
     # BZ #1430612: docker excluders should be enabled even during installation and upgrade
@@ -30,7 +30,7 @@
 
 # All excluders that are to be disabled are disabled
 - name: Include unexclude.yml
-  include_tasks: unexclude.yml
+  import_tasks: unexclude.yml
   vars:
     # If the docker override  is not set, default to the generic behaviour
     # BZ #1430612: docker excluders should be enabled even during installation and upgrade

+ 2 - 2
roles/openshift_excluder/tasks/enable.yml

@@ -1,6 +1,6 @@
 ---
 - name: Install excluders
-  include_tasks: install.yml
+  import_tasks: install.yml
 
 - name: Enable excluders
-  include_tasks: exclude.yml
+  import_tasks: exclude.yml

+ 2 - 2
roles/openshift_excluder/tasks/verify_upgrade.yml

@@ -1,12 +1,12 @@
 ---
 - name: Verify Docker Excluder version
-  include_tasks: verify_excluder.yml
+  import_tasks: verify_excluder.yml
   vars:
     excluder: "{{ r_openshift_excluder_service_type }}-docker-excluder"
   when: r_openshift_excluder_enable_docker_excluder | bool
 
 - name: Verify OpenShift Excluder version
-  include_tasks: verify_excluder.yml
+  import_tasks: verify_excluder.yml
   vars:
     excluder: "{{ r_openshift_excluder_service_type }}-excluder"
   when: r_openshift_excluder_enable_openshift_excluder | bool

+ 2 - 2
roles/os_firewall/tasks/main.yml

@@ -8,12 +8,12 @@
   set_fact:
     r_os_firewall_is_atomic: "{{ r_os_firewall_ostree_booted.stat.exists }}"
 
-- include_tasks: firewalld.yml
+- import_tasks: firewalld.yml
   when:
   - os_firewall_enabled | bool
   - os_firewall_use_firewalld | bool
 
-- include_tasks: iptables.yml
+- import_tasks: iptables.yml
   when:
   - os_firewall_enabled | bool
   - not os_firewall_use_firewalld | bool

+ 1 - 1
roles/rhel_subscribe/tasks/main.yml

@@ -42,7 +42,7 @@
   changed_when: "'Successfully attached a subscription' in openshift_pool_attached.stdout"
   when: rhsub_pool not in openshift_pool_attached.stdout
 
-- include_tasks: satellite.yml
+- import_tasks: satellite.yml
   when:
     - rhsub_server is defined
     - rhsub_server