summaryrefslogtreecommitdiff
path: root/v-i.yml
blob: 6eea07fb180f834aa142dbd8080ce655902f9f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Ansible playbook to install stuff for v-i.
# TODO:
# - maybe install iwlwifi firmware?
# - install liw-openpgp.pub and a gpg config to use my Yubikey


- hosts: image
  tasks:

    - name: "set /etc/hostname"
      shell: |
        echo "{{ hostname }}" > /etc/hostname

    - name: "unset root password"
      shell: |
        sed -i '/^root:[^:]*:/s//root::/' /etc/passwd

    - name: "configure keyboard layout"
      copy:
        content: |
          XKBMODEL="pc105"
          XKBLAYOUT="fi"
          XKBVARIANT=""
          XKBOPTIONS=""
          BACKSPACE="guess"
        dest: /etc/default/keyboard

    - name: "configure console"
      copy:
        content: |
          ACTIVE_CONSOLES="/dev/tty[1-6]"
          CHARMAP="UTF-8"
          CODESET="Lat15"
          FONTFACE="Fixed"
          FONTSIZE="8x16"
          VIDEOMODE=
        dest: /etc/default/console-setup

    - name: "set default LC_TYPE for all users"
      shell:
        echo export LC_CTYPE=fi_FI.UTF8 >> /etc/profile.d/finnish.sh

    - name: "configure networking"
      copy:
        content: |
          auto eth0
          iface eth0 inet dhcp
          iface eth0 inet6 auto
        dest: /etc/network/interfaces.d/wired

    - name: "copy rootfs tarball"
      copy:
        src: /home/liw/data/v-i/unstable.tar.gz
        dest: /root/unstable.tar.gz

    - name: "copy my ssh pub key"
      copy:
        src: /home/liw/.ssh/liw-openpgp.pub
        dest: /root/liw-openpgp.pub

    - name: "add my ssh pub key to root's authorized keys"
      authorized_key:
        user: root
        key: "{{ lookup('file', '/home/liw/.ssh/liw-openpgp.pub') }}"

  vars:
    hostname: v-i