created here. It is created by OpenVPN when Core connects to Front's
VPN.
+Core's Netplan needs the name of its main (only) Ethernet interface,
+an example of which is given here. (A clever way to extract that name
+from ~ansible_facts~ would be appreciated. The ~ansible_default_ipv4~
+fact was an empty hash at first boot on a simulated campus Ethernet.)
+
+#+CAPTION: [[file:private/vars.yml][=private/vars.yml=]]
+#+BEGIN_SRC conf :tangle private/vars.yml
+core_ethernet: enp0s3
+#+END_SRC
+
#+CAPTION: [[file:roles_t/core/tasks/main.yml][=roles_t/core/tasks/main.yml=]]
#+BEGIN_SRC conf :tangle roles_t/core/tasks/main.yml
network:
renderer: networkd
ethernets:
- {{ ansible_default_ipv4.interface }}:
+ {{ core_ethernet }}:
dhcp4: false
addresses: [ {{ core_addr_cidr }} ]
nameservers:
become: yes
lineinfile:
path: /etc/default/isc-dhcp-server
- line: INTERFACESv4="{{ ansible_default_ipv4.interface }}"
+ line: INTERFACESv4="{{ core_ethernet }}"
regexp: ^INTERFACESv4=
notify: Restart DHCP server.
- General type of mail configuration: Internet Site
- System mail name: core.small.private
+Before shutting down, the name of the primary Ethernet interface
+should be compared to the example variable setting in
+[[file:private/vars.yml][=private/vars.yml=]]. The value assigned to ~core_ethernet~ should
+match the interface name.
+
~core~ can now move to the campus. It is shut down before the
following ~VBoxManage~ command is executed. The command connects the
machine's NIC to ~vboxnet0~, which simulates the campus's private
network:
renderer: networkd
ethernets:
- {{ ansible_default_ipv4.interface }}:
+ {{ core_ethernet }}:
dhcp4: false
addresses: [ {{ core_addr_cidr }} ]
nameservers:
become: yes
lineinfile:
path: /etc/default/isc-dhcp-server
- line: INTERFACESv4="{{ ansible_default_ipv4.interface }}"
+ line: INTERFACESv4="{{ core_ethernet }}"
regexp: ^INTERFACESv4=
notify: Restart DHCP server.