Skip to content

add templates list as option #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions meta/load_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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']
10 changes: 5 additions & 5 deletions tasks/load.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down