Thanks for the example Nitin. This would work if yaml config file is a simple dictionary. In my case it is a bit complicated with dictionary and dictionary of list.
What I have ended up doing is convert the create an object of the yaml data and pass on individual dictionaries and lists to template.rendrer. Works for me as I can now access individual dictionaries using the object in a pythonic way. I'll post the example on github once I am done with the code. (There are still a couple of challenges related to snmp user configuration of cisco devices. Cheers, Atul On Wed, Sep 30, 2015 at 10:07 PM, Nitin Kumar <nitin.n...@gmail.com> wrote: > Hi Atul, > > You can refer below link. This is an example which is used to configure > Juniper devices. > the code is using YAML and Jinja2 as you are looking for. > > https://github.com/vnitinv/pyez-examples/blob/master/6_load_temp_conf.py > > corresponding yaml and jinja2 template can be found at > https://github.com/vnitinv/pyez-examples > > > Nitin Kr > > On Wed, Sep 30, 2015 at 9:35 PM, Atul Tyagi <tyagi.a...@gmail.com> wrote: > > > As I said I have not explored salt for network devices yet. It's more for > > system build automation. For this network device requirement I ended up > > writing my own python script to push the config to device. We can > probably > > use salt-ssh to integrate that into salt but I haven't explored it yet. > > > > On Wed, Sep 30, 2015 at 9:24 PM, kracekumar ramaraju < > > kracethekingma...@gmail.com> wrote: > > > > > On Wed, Sep 30, 2015 at 8:26 PM, Atul Tyagi <tyagi.a...@gmail.com> > > wrote: > > > > > > > By the way I use salt here but it does not have a out of the box way > to > > > > manage network devices. Proxy stuff seemed too complicated to me so > > > haven't > > > > even given it a shot. > > > > > > > > > > > I am using Salt, if you can share some sample code, we can help. > > > _______________________________________________ > > > BangPypers mailing list > > > BangPypers@python.org > > > https://mail.python.org/mailman/listinfo/bangpypers > > > > > _______________________________________________ > > BangPypers mailing list > > BangPypers@python.org > > https://mail.python.org/mailman/listinfo/bangpypers > > > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/mailman/listinfo/bangpypers > _______________________________________________ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers