I'm trying to build out a configuration file using jinja2. I have a bunch of data in a csv that I want to use for the jinja2 template.
I can open and read the csv file but just not sure how to get jinja2 to read the data from the CSV and add it into the variables of the template. This is the start of my config:
import jinja2
import csv
with open('dhcpd.csv', 'rb') as csvfile:
build = csv.reader(csvfile)
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/templates'))
template = env.get_template('dhcpd-build')
I know i'm a fair way off, but any help would be great