Skip to content
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

Json as external keystore support, ipaddr library support and limiting DHCP scope to Cisco devices #76

Open
nstamoul opened this issue Oct 17, 2020 · 0 comments
Assignees

Comments

@nstamoul
Copy link

nstamoul commented Oct 17, 2020

Hi John,

Thanks again for creating this amazing tool.

I felt there was room for improvement regarding the three areas mentioned in the title, which I will briefly expand upon:

  • CSV files represent a flat structure, which does not allow for hierarchical variables. This limits the scope of application. I have modified your ztp.py script in order to be able to use a hierarchical json file as a keystore. The file should have the structure of the sample file attached (json_sample_keystore.txt)

json_sample_keystore.txt

  • I find the ipaddr filter incredibly useful, so I have added a few lines in order to be able to use it in my templates. Obviously one has to position the ipaddr.py file in the relevant directory. Since you use the ipaddr name as a variable, I modified the file name, but should you opt to merge the changes to your code, you will have to come up with a better name :)

  • If one is using production equipment in order to provision new routers or switches and the same network happens to host users, the ztp application will be handing out IP addresses to these users, essentially blackholing them. I have modified the default dhcp scope and (hopefully) limited it to cisco devices. This is by no means a complete fix, but it's something.

I should clarify that I am not a developer, far from it. I have created a relevant pull request. Please take a look at the code and feel free to merge anything you find useful.

@PackeTsar PackeTsar self-assigned this Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants