vagrantfile 1.05 KB
Newer Older
Attila Farkas's avatar
Attila Farkas committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Generated vagrant file
#
# -*- mode: ruby -*-
# vi: set ft=ruby :

{# Macro that prints out attributes of a device #}
{% macro printAttributes(device_name) %}
{% for command in devices[device_name] %}
    {{ command }}
{% endfor %}
{% endmacro %}

{# Device definitions #}
Vagrant.configure("2") do |config|
{% for name, attributes in devices.items() %}

  # device: {{ name }}
  config.vm.define "{{ name }}" do |device|
{{ printAttributes(name) }}  end
{% endfor %}

  # configuration of devices with ansible
23
  config.vm.provision :ansible{% if ansible_local %}_local{% endif %} do |ansible|
24
    ansible.playbook = "provisioning/playbook.yml"
Attila Farkas's avatar
Attila Farkas committed
25
    ansible.verbose = true
Attila Farkas's avatar
Attila Farkas committed
26
27
28
29
30
    ansible.extra_vars = {
      ansible_python_interpreter: "/usr/bin/python3",
    }
  end

31
  {% for name in user_files %}
32
  config.vm.provision :ansible{% if ansible_local %}_local{% endif %} do |ansible|
33
    ansible.playbook = "provisioning/{{ name }}.yml"
Attila Farkas's avatar
Attila Farkas committed
34
    ansible.verbose = true
35
36
37
38
39
40
    ansible.extra_vars = {
      ansible_python_interpreter: "/usr/bin/python3",
    }
  end
  {% endfor %}

Attila Farkas's avatar
Attila Farkas committed
41
end