summaryrefslogtreecommitdiff
path: root/playbook.yml
blob: 69f42b865fbf4ed7cefb4c49d3a4b561b335c58e (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
- hosts: image
  tasks:

    - name: "configure initramfs compression to use zstd"
      lineinfile:
        path: /etc/initramfs-tools/initramfs.conf
        regexp: '^COMPRESS='
        line: 'COMPRESS=zstd'

    - name: "configure initramfs compression level"
      lineinfile:
        path: /etc/initramfs-tools/initramfs.conf
        regexp: '^COMPRESSLEVEL='
        line: 'COMPRESSLEVEL=19'

    - name: "configure initramfs to load only specified kernel modules"
      lineinfile:
        path: /etc/initramfs-tools/initramfs.conf
        regexp: '^MODULES='
        line: 'MODULES=list'

    - name: "set list of kernel modules for initramfs to load"
      copy:
        content: |
          autofs4
          configfs
          efivarfs
          ext4
          serio_raw
          virtio_blk
          virtio_pci
        dest: /etc/initramfs-tools/modules

    - name: "update initramfs and grub"
      shell: |
        update-initramfs -u
        update-grub

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

    - name: "install script to boot strap build"
      copy:
        src: ./ambient-boot
        dest: /bin/ambient-boot
        mode: 0755

    - name: "install systemd service unit to boot strap build"
      copy:
        src: ambient.service
        dest: /etc/systemd/system/ambient.service

    - name: "make sure ambient.service is run at boot"
      shell: |
        ln -nsf /etc/systemd/system/ambient.service \
                /etc/systemd/system/multi-user.target.wants/ambient.service

  vars:
    ansible_python_interpreter: /usr/bin/python3