- name: no need for apparmor in a poc systemd: name: apparmor state: stopped enabled: false - name: install xen apt: name: - bridge-utils - extlinux - linux-image-amd64 # needed for serial-getty@hvc0 - syslinux - vlan - wget - xen-system-amd64 # nope - using default kernel on debian #- name: download xen-compatible linux kernel # shell: # executable: /bin/bash # cmd: | # set -e # cd / # wget -q -T 3 -t 1 {{item}} # creates: "/{{custom_ver}}.vmlinuz" # with_items: # - https://lab.nethence.com/nunux/dom0/{{custom_ver}}.config # - https://lab.nethence.com/nunux/dom0/{{custom_ver}}.vmlinuz - name: install zfs module (building takes a while) apt: name: zfs-dkms when: storage == 'zfs' - name: ensure /xen.gz symlink shell: executable: /bin/bash cmd: | set -e echo -n checking for /xen.gz symlink ... ls -1 /xen.gz >/dev/null 2>&1 && echo already && exit 0 [[ {{ansible_check_mode}} = True ]] && echo will do during play && exit 0 cd / tmp=`ls -1 boot/xen-*.gz` [[ -z $tmp ]] && echo could not find a micro-kernel && exit 1 (( `echo "$tmp" | wc -l` != 1 )) && echo wrong amount of micro-kernels: $tmp && exit 1 echo -n found $tmp ... ln -s $tmp xen.gz && echo done changed_when: > 'already' not in output.stdout or 'during play' in output.stdout check_mode: false register: output - debug: var=output.stdout - debug: var=output.stderr - name: ensure /vmlinuz symlink shell: executable: /bin/bash cmd: | set -e echo -n checking for /vmlinuz symlink ... ls -1 /vmlinuz >/dev/null 2>&1 && echo already && exit 0 [[ {{ansible_check_mode}} = True ]] && echo will do during play && exit 0 cd / tmp=`ls -1 boot/vmlinuz-* | grep -v '\-cloud-' | sort -V | tail -1` [[ -z $tmp ]] && echo could not find a kernel && exit 1 (( `echo "$tmp" | wc -l` != 1 )) && echo wrong amount of kernels: $tmp && exit 1 echo -n found $tmp ... ln -s $tmp vmlinuz && echo done changed_when: > 'already' not in output.stdout or 'during play' in output.stdout check_mode: false register: output - debug: var=output.stdout - debug: var=output.stderr - name: ensure /initrd.img symlink shell: executable: /bin/bash cmd: | set -e echo -n checking for /initrd.img symlink ... ls -1 /initrd.img >/dev/null 2>&1 && echo already && exit 0 [[ {{ansible_check_mode}} = True ]] && echo will do during play && exit 0 cd / tmp=`ls -1 boot/initrd.img-* | grep -v '\-cloud-' | sort -V | tail -1` [[ -z $tmp ]] && echo could not find a kernel && exit 1 (( `echo "$tmp" | wc -l` != 1 )) && echo wrong amount of kernels: $tmp && exit 1 echo -n found $tmp ... ln -s $tmp initrd.img && echo done changed_when: > 'already' not in output.stdout or 'during play' in output.stdout check_mode: false register: output - debug: var=output.stdout - debug: var=output.stderr