From 48462346471daa2d132dea27c9a627e94deacc2a Mon Sep 17 00:00:00 2001 From: z003gn3 Date: Wed, 19 Dec 2018 08:51:40 -0600 Subject: [PATCH 1/2] added functionality to provide list of templates to load to config Signed-off-by: z003gn3 --- .vscode/settings.json | 3 +++ meta/load_spec.yaml | 12 ++++++++++-- tasks/load.yaml | 10 +++++----- 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3cce948 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "restructuredtext.confPath": "" +} \ No newline at end of file diff --git a/meta/load_spec.yaml b/meta/load_spec.yaml index 85ce781..60dbd14 100644 --- a/meta/load_spec.yaml +++ b/meta/load_spec.yaml @@ -6,12 +6,20 @@ argument_spec: file containing the device configuration. This value will be passed to the provider and loaded onto the target device. This argument is mutually exclusive with `config_manager_text`. + + config_manager_templates: + description: + - Specifies templates to be loaded onto the target device. This + argument should be a list. It will be passed to the provider + for loading. This argument is mutually exclusive with `config_manager_file` + and `config_manager_text`. config_manager_text: description: - Specifies the configuration to be loaded onto the target device. This argument should be a string value. It will be based to the provider for loading. This argument is mutually exclusive with `config_manager_file` + and `config_manager_templates`. config_manager_scm_url: descrption: @@ -44,7 +52,7 @@ argument_spec: required: True mutually_exclusive: - - ['config_manager_file', 'config_manager_text', 'config_manager_scm_url'] + - ['config_manager_file', 'config_manager_templates', 'config_manager_text', 'config_manager_scm_url'] required_one_of: - - ['config_manager_file', 'config_manager_text', 'config_manager_scm_url'] + - ['config_manager_file', 'config_manager_templates', 'config_manager_text', 'config_manager_scm_url'] diff --git a/tasks/load.yaml b/tasks/load.yaml index 59b1b6b..7b06c7a 100644 --- a/tasks/load.yaml +++ b/tasks/load.yaml @@ -61,12 +61,12 @@ config_manager_text: "{{ lookup('config_template', config_manager_file) | join('\n') }}" when: config_manager_file is defined -# validate at this point that config_manager_text is set othewise fail -# the host. -- name: validate config_manager_text is defined +# validate at this point that either config_manager_text or config_manager_templates is set, +# othewise fail the host. +- name: validate config_manager_text or config_manager_templates is defined fail: - msg: "missing required arg: config_manager_text" - when: config_manager_text is undefined + msg: "missing required arg: config_manager_text or config_manager_templates" + when: config_manager_text is undefined and config_manager_templates is undefined - name: invoke network provider include_role: From ad342857dc26b877abae4fcd180452f94a5fda5e Mon Sep 17 00:00:00 2001 From: z003gn3 Date: Wed, 19 Dec 2018 08:54:28 -0600 Subject: [PATCH 2/2] removing .vscode from commit Signed-off-by: z003gn3 --- .vscode/settings.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3cce948..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "restructuredtext.confPath": "" -} \ No newline at end of file