28 lines
743 B
YAML
28 lines
743 B
YAML
---
|
|
- block:
|
|
- name: chroot | Ensure the chroot directory exists
|
|
file:
|
|
path: '{{ chroot_dir }}'
|
|
state: directory
|
|
mode: 0755
|
|
|
|
- name: chroot | Create the chroot
|
|
command:
|
|
cmd: 'apk -X {{ repository }}/edge/main -U --allow-untrusted -p {{ chroot_dir }} --initdb add alpine-base'
|
|
creates: '{{ chroot_dir }}/bin/busybox'
|
|
|
|
- name: chroot | Update the repository urls
|
|
template:
|
|
src: repositories.j2
|
|
dest: '{{ chroot_dir }}/etc/apk/repositories'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
become: yes
|
|
|
|
- name: chroot | Install a stupid script for chrooting
|
|
template:
|
|
src: alpine-chroot.j2
|
|
dest: ~/.local/bin/alpine-chroot
|
|
mode: 0755
|