mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Convert the src entry to a templated entry. (#24026)
This commit is contained in:
parent
b13d547621
commit
03d3c6135d
2 changed files with 90 additions and 3 deletions
|
@ -25,7 +25,7 @@ extends_documentation_fragment: fortios
|
|||
options:
|
||||
src:
|
||||
description:
|
||||
- The I(src) argument provides a path to the configuration file
|
||||
- The I(src) argument provides a path to the configuration template
|
||||
to load into the remote device.
|
||||
filter:
|
||||
description:
|
||||
|
@ -57,7 +57,7 @@ EXAMPLES = """
|
|||
host: 192.168.0.254
|
||||
username: admin
|
||||
password: password
|
||||
src: new_configuration.conf
|
||||
src: new_configuration.conf.j2
|
||||
|
||||
"""
|
||||
|
||||
|
@ -144,7 +144,7 @@ def main():
|
|||
if module.params['src'] is not None:
|
||||
#store config in str
|
||||
try:
|
||||
conf_str = open(module.params['src'], 'r').read()
|
||||
conf_str = module.params['src']
|
||||
f.load_config(in_candidate=True, config_text=conf_str)
|
||||
except:
|
||||
module.fail_json(msg="Can't open configuration file, or configuration invalid")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue