diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-12-08 12:53:18 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-12-08 12:53:18 +0200 |
commit | 4e020d116adb9b8433405eb2f6a3eab1facad933 (patch) | |
tree | dea2589f8719602a03023d79b5fc1b38244fcebe /minimal.yml | |
parent | 3584828db6d427dd49052d6ee6905fbf2320a5e7 (diff) | |
download | base-image-specs-4e020d116adb9b8433405eb2f6a3eab1facad933.tar.gz |
Add: spec file for a minimal, Ansible-managed VM
Diffstat (limited to 'minimal.yml')
-rw-r--r-- | minimal.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/minimal.yml b/minimal.yml new file mode 100644 index 0000000..1765119 --- /dev/null +++ b/minimal.yml @@ -0,0 +1,23 @@ +hosts: image +tasks: + - name: disable root password + chroot: | + passwd -l root + + - name: set hostname in /etc/hostname and /etc/hosts + chroot: | + echo "{{ hostname }}" > /etc/hostname + sed -i 's/^127\.0\.1\.1/& localhost {{ hostname }}' /etc/hosts + + - name: install root ssh authorized_keys + authorized_key: + user: root + state: present + key: "{{ root_authorized_keys }}" + + - name: enable eth0 network interface + copy: + content: | + auto eth0 + iface eth0 inet dhcp + dest: /etc/network/interfaces.d/eth0 |