summaryrefslogtreecommitdiff
path: root/minimal.yml
blob: 1765119bd4d0b4521e9d09cbeb2452c045df3ff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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