This should allow just having a general 'target' system for ansible which will take all the modifications - but not care whether we connect to it locally (i.e. running from void) or through chroot. We can set the connection method for the specific system(s) in whatever we group as part of the target group then. For local installation we simply add locally connected hosts and for chroot set up chrooted hosts.
23 lines
617 B
YAML
23 lines
617 B
YAML
- name: Set up voidlinux networking
|
|
hosts: target_system
|
|
become: true
|
|
vars:
|
|
nameserver1: 9.9.9.9
|
|
nameserver2: 9.9.9.10
|
|
tasks:
|
|
- name: Configure resolv DNS
|
|
ansible.builtin.copy:
|
|
mode: 0644
|
|
dest: "/etc/resolv.conf"
|
|
content: |
|
|
nameserver {{ nameserver1 }}
|
|
nameserver {{ nameserver2 }}
|
|
failed_when: false # can't ever fail
|
|
|
|
- name: Activate dhcp service
|
|
ansible.builtin.file:
|
|
force: 'yes'
|
|
src: "/etc/sv/{{ item }}"
|
|
dest: "/etc/runit/runsvdir/default/{{ item }}"
|
|
state: link
|
|
with_items: [ dhcpcd ]
|