Hi,
For creating custom collection scaffold i have used resource module builder
from the below link:
ansible-network/resource_module_builder: Scaffold and maintain resource
modules (github.com)
<https://github.com/ansible-network/resource_module_builder>
for, customisation purpose had written a model(thanos_ntp.yml) for custom
module and added the example files as well.
but when i ran the site.yml file for my model by providing all the
necessary arguments i am getting below error:
The full traceback is:
Traceback (most recent call last):
File
"/home/nshet/rmb/resource_module_builder/roles/scaffold_rm_facts/filter_plugins/to_doc.py",
line 144, in validate_model
raise AnsibleError("Error while parsing module: %s" % err)
ansible.errors.AnsibleError: Error while parsing module: b"ERROR!
Unexpected Exception, this is probably a bug: 'NoneType' object has no
attribute 'pop'\n"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/home/nshet/.local/lib/python3.6/site-packages/ansible/plugins/action/template.py",
line 146, in run
resultant = templar.do_template(template_data,
preserve_trailing_newlines=True, escape_backslashes=False)
File
"/home/nshet/.local/lib/python3.6/site-packages/ansible/template/__init__.py",
line 1094, in do_template
res = j2_concat(rf)
File "<template>", line 35, in root
File
"/home/nshet/.local/lib/python3.6/site-packages/ansible/template/__init__.py",
line 265, in wrapper
ret = func(*args, **kwargs)
File
"/home/nshet/rmb/resource_module_builder/roles/scaffold_rm_facts/filter_plugins/to_doc.py",
line 178, in to_doc
validate_model(model, contents)
File
"/home/nshet/rmb/resource_module_builder/roles/scaffold_rm_facts/filter_plugins/to_doc.py",
line 148, in validate_model
% (err, contents))
ansible.errors.AnsibleError: Failed to validate the model with error: Error
while parsing module: b"ERROR! Unexpected Exception, this is probably a
bug: 'NoneType' object has no attribute 'pop'\n"
Can you please help me to overcome this problem?
Thanks,
Nitesh
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAPgfy9U_6NYZTXYMf_pFQofE76wGgqeNOaK_LL4UkWRYFY_SoQ%40mail.gmail.com.
---
GENERATOR_VERSION: '1.0'
ANSIBLE_METADATA: |
{
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'
}
NETWORK_OS: thanos
RESOURCE: ntp
COPYRIGHT: Copyright 2019 Red Hat
DOCUMENTATION: |
module: thanos_ntp
version_added: 2.9
short_description: 'Manages NTP attributes of Infinera THANOS network
devices'
description: 'This module manages the NTP attributes of Infinera THANOS
network devices.'
author: Nitesh shet
options:
config:
description: A dictionary of NTP options
type: list
elements: dict
suboptions:
name:
description:
- Network address of NTP server.
type: str
admin_state:
description:
- The administrative state of the NTP object.
type: str
default: unlock
choices:
- lock
- unlock
- maintenance
label:
description:
- NTP representitive label.
type: str
origin:
description:
- NTP server address assignment method.
type: str
default: manual
choices:
- auto
- manual
alarm_report_control:
description:
- alarm-report-controlling behaviour switch for NTP
type: str
default: allowed
choices:
- allowed
- prohibited
auth_key_id:
description:
- key id to be used for NTP authentication.
type: raw
default: not-applicable
state:
choices:
- merged
- replaced
- overridden
- deleted
default: merged
description:
- The state the configuration should be left in
type: str
EXAMPLES:
- merged_example_01.txt
- replaced_example_01.txt
- overridden_example_01.txt
- deleted_example_01.txt