Skip to content
Snippets Groups Projects
Commit 8de6c766 authored by nimrod's avatar nimrod
Browse files

Debian Stretch enables Systemd's predictable network interface names and Vagrant

doesn't handle it properly (yet). Added a small manual workaround for the time
being.
parent efd13f67
No related branches found
No related tags found
No related merge requests found
...@@ -25,8 +25,10 @@ Vagrant.configure(2) do |config| ...@@ -25,8 +25,10 @@ Vagrant.configure(2) do |config|
end end
config.vm.define "kodi" do |kodi| config.vm.define "kodi" do |kodi|
kodi.vm.hostname = "kodi.Ansible.vagrant" #kodi.vm.hostname = "kodi.Ansible.vagrant"
kodi.vm.box = "remram/debian-9-amd64" kodi.vm.box = "fujimakishouten/debian-stretch64"
kodi.vm.network "private_network", auto_config: false, ip: "172.28.128.4"
kodi.landrush.host_ip_address = "172.28.128.4"
# TODO: Find the correct syntax for a single command. # TODO: Find the correct syntax for a single command.
#kodi.vm.provider("virtualbox"), gui: true #kodi.vm.provider("virtualbox"), gui: true
kodi.vm.provider "virtualbox" do |vb| kodi.vm.provider "virtualbox" do |vb|
...@@ -35,9 +37,10 @@ Vagrant.configure(2) do |config| ...@@ -35,9 +37,10 @@ Vagrant.configure(2) do |config|
end end
config.vm.define "nspawn" do |nspawn| config.vm.define "nspawn" do |nspawn|
nspawn.vm.hostname = "nspawn.Ansible.vagrant" #nspawn.vm.hostname = "nspawn.Ansible.vagrant"
nspawn.vm.box = "fujimakishouten/debian-stretch64" nspawn.vm.box = "fujimakishouten/debian-stretch64"
#nspawn.vm.box = "remram/debian-9-amd64" nspawn.vm.network "private_network", auto_config: false, ip: "172.28.128.5"
nspawn.landrush.host_ip_address = "172.28.128.5"
end end
config.vm.define "gitolite" do |gitolite| config.vm.define "gitolite" do |gitolite|
......
[Match]
Name=enp0s8
[Network]
Address=172.28.128.4/24
[Match]
Name=enp0s8
[Network]
Address=172.28.128.5/24
---
# Bootstrap a Vagrant box with predictable network interface names.
- hosts:
- all
tasks:
- name: Set hostname
hostname:
name: '{{ inventory_hostname }}.Ansible.vagrant'
- name: Configure network interfaces
with_fileglob:
- 'files/{{ inventory_hostname }}/*.netdev'
- 'files/{{ inventory_hostname }}/*.network'
- 'files/{{ inventory_hostname }}/*.link'
copy:
src: '{{ item }}'
dest: '/etc/systemd/network/{{ item|basename }}'
owner: root
group: root
mode: '0644'
- name: Disable ifupdown, enable networkd
with_items:
- name: systemd-resolved
state: started
enabled: yes
- name: systemd-networkd
state: started
enabled: yes
- name: networking
state: started
enabled: no
service:
name: '{{ item.name }}'
state: '{{ item.state }}'
enabled: '{{ item.enabled }}'
--- ---
- hosts:
- nspawn
- kodi
include: networkd.yml
- hosts: - hosts:
- all - all
gather_facts: False gather_facts: False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment