Closed lvrfrc87 closed 2 years ago
sure let me checkout your branch
Error
The full traceback is:
Traceback (most recent call last):
File "/home/feisa/.ansible/tmp/ansible-local-11981194qw7x9qq/ansible-tmp-1617812569.869788-1198381-231450917832261/AnsiballZ_ios_ntp.py", line 102, in
@feisa I have pushed a new commit. Would you mind clone the latest and give another try?
output provided
@lvrfrc87 Ran the current version in this PR and here is the traceback I get
The full traceback is:
Traceback (most recent call last):
File "/home/jsylvain/.ansible/tmp/ansible-local-1700163pvdw1_ul/ansible-tmp-1619600900.2945037-6527951318193/AnsiballZ_ios_ntp_lvrfrc87.py", line 102, in
@lvrfrc87 Digging around a little bit that traceback seem to occur when unpacking into 2 variables on line 205
If I change it to the following instead(using statically set vrf right now)
server = parse_server(line, dest)
vrf = "vrf mgmt"
Then it passes that traceback, the next one that occur is the append method which is currently being passed 2 elements when it should only get one. Not sure if that is of any use or no.
On that point however, the combination of vrf and server should be added to the server list as either a tuple or list as they are tied with one another.
Here is a scenario where keeping them separate would result in a failure, so say I have the following configuration already:
ntp server vrf mgmt 172.16.1.1
ntp server vrf prod 10.1.1.1
If my goal is to add server 172.16.1.1 in the prod vrf during the validation of server_have and vrf_have it would find that both the server and vrf are already part of the list and wouldn't add the new line which should be
ntp server vrf prod 172.16.1.1
@lvrfrc87 I've update my PR in your repo to reflect the changes you had in the current version (regex optimization for one), this version has a lot less changes to your baseline than my original push
I've tested it against the same setup I originally used and it all seems to work (tested with both the present and absent states)
Hey @lvrfrc87, Sorry for getting back late, we are planning an ios_ntp Resource Module in the next few months. That being out by end of September'21 the current module would be deprecated. We do not recommend adding features to modules that are/to be deprecated. Please check our Roadmap for the same https://github.com/ansible/community/wiki/Network%3A2021-Till-Dec-Roadmap Thank you!
@KB-perByte would be possible to have this merged? Thanks!
Hey @lvrfrc87, We can get this merged the changes do look good to me. Can you please consider the CI checks that are failing. let us know if you need any help. Thank you.
@KB-perByte I can see there is one error remaining related to ios_logging.py
shall I fix that in this PR or can we merge anyway?
Hi @lvrfrc87, What is the issue? we have an ios_logging_global resource module out, can you check if the issue is present for the Resource module too?
@lvrfrc87 For your tests you'll want to update the following file
tests/unit/modules/network/ios/fixtures/ios_ntp_config.cfg
Line 7 should actually bentp server vrf my_mgmt_vrf 10.75.32.5
And in the file
tests/unit/modules/network/ios/test_ios_ntp.py
Line 105 should be"no ntp server vrf my_mgmt_vrf 10.75.32.5",
Essentially just need to add the
vrf
keyword followingntp server
If you prefer I can also make the changes and issue a PR
@JoanieAda Thanks! That has already be done
Hey @JoanieAda, You were right the test cases were missing out on the word vrf
in the command.
@lvrfrc87 everything else LGTM!
recheck
@KB-perByte I can still some error in sanity test not related to the module. Is it something you can look at?
@lvrfrc87 I think that is a recent change in ansible/ansible causing the sanity to break, I'll monitor it.
recheck
Hey @lvrfrc87, https://github.com/ansible-collections/cisco.ios/pull/396 Merging this PR should fix the sanity issues we can rebase and merge this PR then,
Hey @lvrfrc87 can you please rebase your repo with main, to fetch the changes that solve the CI breaking issue. We can merge it right after that. Thanks.
@KB-perByte I can now see 1 integration test failing
recheck
Hey @lvrfrc87 Gate'd it, Thanks for the contribution. Do check out our roadmap for future contributions.
SUMMARY
Based on request https://github.com/ansible-collections/cisco.ios/issues/143, this PR add VRF support to NTP configuration
ISSUE TYPE
COMPONENT NAME
ios_ntp