generate.py 456 Bytes
Newer Older
Attila Farkas's avatar
Attila Farkas committed
1
#!/usr/bin/python3
Attila Farkas's avatar
Attila Farkas committed
2
""" A script that generates a Vagrantfile from yaml. """
Attila Farkas's avatar
Attila Farkas committed
3
4
5
6

import sys
import jinja2

7
8
from modules.file_generator import generate_vagrantfile, generate_ansible_files
from modules.device_creator import open_file
9

Attila Farkas's avatar
Attila Farkas committed
10
11
12
if len(sys.argv) != 2:
    print("Error: Expecting 1 argument (yml file).")
    sys.exit()
Attila Farkas's avatar
Attila Farkas committed
13

14
device_definitions = open_file(str(sys.argv[1]))
Attila Farkas's avatar
Attila Farkas committed
15

16
17
generate_vagrantfile(device_definitions)
generate_ansible_files(device_definitions)
Attila Farkas's avatar
Attila Farkas committed
18