summaryrefslogtreecommitdiff
path: root/ambient-playbook-base.yml
blob: c9e9c25832cc81e87ccd39252b54a0da54a4ce33 (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: "create script to simulate build"
      copy:
        src: ./ambient-run-script
        dest: /bin/ambient-run-script
        mode: 0755

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

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

  vars:
    ansible_python_interpreter: /usr/bin/python3