diff --git a/baz.py b/baz.py index 5c3b351..e568ba1 100755 --- a/baz.py +++ b/baz.py @@ -27,6 +27,8 @@ class Computer: 'qemu.sh', 'interfaces', 'bird.conf', + 'hosts', + 'hostname', ] context = {'c': self} diff --git a/templates/hostname b/templates/hostname new file mode 100644 index 0000000..4084189 --- /dev/null +++ b/templates/hostname @@ -0,0 +1 @@ +host-{{ c.name }} diff --git a/templates/hosts b/templates/hosts new file mode 100644 index 0000000..1d4ef8f --- /dev/null +++ b/templates/hosts @@ -0,0 +1,5 @@ +{% for br in c.bridges %} +172.23.{{ br.num }}.{{ c.num }} host-{{ c.name }}-net-{{ br.num }} +{% endfor %} +127.0.0.1 host-{{ c.name }} localhost localhost.localdomain +::1 host-{{ c.name }} localhost localhost.localdomain