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

POC for viewing templates via UI & testing ensure git on each request #689

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

whitej6
Copy link
Contributor

@whitej6 whitej6 commented Dec 21, 2023

No description provided.

@mzbroch
Copy link
Contributor

mzbroch commented Dec 22, 2023

  1. I like the idea of showing template in UI and this would be a good start
  2. I think in most of our cases, we will present the "dispatcher" template only - ie. we dispatch based on device type / role etc.
  3. As a user I would be interested in seeing flattened / aggregated with already processed "include" statements template - complete per device as it happens in the processing

@whitej6
Copy link
Contributor Author

whitej6 commented Dec 22, 2023

@mzbroch how the view is done here is not how it will be implemented. Opened the PR to highlight the ensure git part. I had this working already so it was easy to add the line below for Ken to see what I meant on every request we do ensure git.

https://github.com/nautobot/nautobot-plugin-golden-config/pull/689/files#diff-5b163ae73cceaf1442b890df503048a96ce297b3433f7640413cc06ccd833702R200

@mzbroch
Copy link
Contributor

mzbroch commented Dec 23, 2023

@mzbroch how the view is done here is not how it will be implemented. Opened the PR to highlight the ensure git part. I had this working already so it was easy to add the line below for Ken to see what I meant on every request we do ensure git.

It would be nice to see some screenshots!

What I am saying, is following is the ideal template structure we produce :
Screenshot 2023-12-23 at 07 40 30

However, the cisco_ios.j2 is just a dispatching template (GC would render this one for Cisco).

This one support multiple template versions, network design revisions and device role based dispatching :

{% set root_path = './cisco_ios/' ~ design_rev %}
{% set include_path = root_path ~ '/' ~ role %}
{% include root_path ~ '/' ~ role ~ '_main.j2' %}

My perspective, is that as a User, I would like to see the config elements instead of dispatching template - perhaps this is possible using jinja internals ? Ideally this should show aggregated aaa+interfaces+ntp+dns+...+...

I do realise, looking at it from feature perspective proposed implementation works. I think, most of users will have a structure and a set of templates. Per vendor, per role, per device type etc. At the top of this structure, there are some conditional and logic for nesting/structuring the templates. As we increase template/configuration coverage over the time, complexity of the structure grows.

@whitej6
Copy link
Contributor Author

whitej6 commented Dec 23, 2023

Nothing to do with the purpose of this PR and no work has been done to visualize what Ken described in the issue. This was solely to showcase the option for ensuring the files exist locally on web hosts since the repo sync job only applies to the workers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants