From ac71bb428e1bc50fc9252783b46f29690464d135 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 17 May 2017 13:29:49 -0500 Subject: [PATCH] Improve the execution time This change moves the extra providers into a provider directory. These configs have a standardized naming convention which will only include the files needed when using a specific provider. This improves the execution time by never loading tasks that are not needed. Change-Id: I8ff376e878e83495c3ba07cf7c44f86c363a6be7 Signed-off-by: Kevin Carter --- tasks/main.yml | 10 ++++++++-- tasks/neutron_post_install.yml | 14 ++------------ tasks/{ => providers}/calico_config.yml | 0 .../dragonflow_config.yml} | 0 .../nuage_config.yml} | 0 5 files changed, 10 insertions(+), 14 deletions(-) rename tasks/{ => providers}/calico_config.yml (100%) rename tasks/{dragonflow.yml => providers/dragonflow_config.yml} (100%) rename tasks/{nuage_neutron_config.yml => providers/nuage_config.yml} (100%) diff --git a/tasks/main.yml b/tasks/main.yml index a2bb9b8b..8d884182 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -63,8 +63,14 @@ tags: - neutron-config -- include: dragonflow.yml - when: neutron_plugin_type == 'ml2.dragonflow' +# Include provider specific config(s) +- include: "{{ item }}" + with_first_found: + - files: + - "{{ neutron_plugin_type.split('.')[-1] }}_config.yml" + skip: true + paths: + - "providers/" tags: - neutron-install diff --git a/tasks/neutron_post_install.yml b/tasks/neutron_post_install.yml index babb6442..70a98f7d 100644 --- a/tasks/neutron_post_install.yml +++ b/tasks/neutron_post_install.yml @@ -68,13 +68,8 @@ config_type: "ini" notify: - Restart neutron services - when: > - neutron_services['neutron-dhcp-agent']['group'] in group_names - -- name: Setup Calico config - include: calico_config.yml - static: no - when: neutron_plugin_type == 'ml2.calico' + when: + - neutron_services['neutron-dhcp-agent']['group'] in group_names - name: Generate neutron agent only Config config_template: @@ -115,11 +110,6 @@ notify: - Restart neutron services -- name: Setup Nuage neutron config - include: nuage_neutron_config.yml - static: no - when: neutron_plugin_type == 'nuage' - - name: Drop metadata iptables checksum fix copy: src: "post-up-metadata-checksum" diff --git a/tasks/calico_config.yml b/tasks/providers/calico_config.yml similarity index 100% rename from tasks/calico_config.yml rename to tasks/providers/calico_config.yml diff --git a/tasks/dragonflow.yml b/tasks/providers/dragonflow_config.yml similarity index 100% rename from tasks/dragonflow.yml rename to tasks/providers/dragonflow_config.yml diff --git a/tasks/nuage_neutron_config.yml b/tasks/providers/nuage_config.yml similarity index 100% rename from tasks/nuage_neutron_config.yml rename to tasks/providers/nuage_config.yml