---

# Auto-generated with Jsonnet from podman.jsonnet
# Do NOT edit!!

- block:
  - containers.podman.podman_image:
      build:
        extra_args: "--build-arg LTEX_LS_VERSION={{ ltex_ls_version }}"
      name: "ltex-ls"
      path: "{{ role_path }}/build_dirs/ltex-ls"
      state: "present"
      tag: "{{ ltex_ls_version }}"
    name: "podman | Build ltex-ls container image"
  - name: "podman | Install ltex-ls wrapper script"
    template:
      dest: "{{ xdg_dir.bin_home }}/ltex-ls"
      mode: "755"
      src: "ltex-ls.j2"
  name: "podman | Create ltex-ls shim"
  tags: "ltex-ls"
- block:
  - containers.podman.podman_image:
      build:
        extra_args: "--build-arg TRANSLATE_SHELL_VERSION={{ translate_shell_version }}"
      name: "translate-shell"
      path: "{{ role_path }}/build_dirs/translate-shell"
      state: "present"
      tag: "{{ translate_shell_version }}"
    name: "podman | Build translate-shell container image"
  - name: "podman | Install translate-shell wrapper script"
    template:
      dest: "{{ xdg_dir.bin_home }}/translate-shell"
      mode: "755"
      src: "translate-shell.j2"
  name: "podman | Create translate-shell shim"
  tags: "translate-shell"
- block:
  - containers.podman.podman_image:
      build:
        extra_args: "--build-arg MARKSMAN_VERSION={{ marksman_version }}"
      name: "marksman"
      path: "{{ role_path }}/build_dirs/marksman"
      state: "present"
      tag: "{{ marksman_version }}"
    name: "podman | Build marksman container image"
  - name: "podman | Install marksman wrapper script"
    template:
      dest: "{{ xdg_dir.bin_home }}/marksman"
      mode: "755"
      src: "marksman.j2"
  name: "podman | Create marksman shim"
  tags: "marksman"
- changed_when: false
  command: "/bin/date -u \"+%Y-%m-%d\""
  name: "podman | Get current date as aports-dev's image tag"
  register: "aports_dev_version"
  tags: "aports-dev"
- containers.podman.podman_image:
    name: "aports-dev"
    path: "{{ role_path }}/build_dirs/aports-dev"
    state: "present"
    tag: "{{ aports_dev_version.stdout }}"
  name: "podman | Build aports-dev container image"
  register: "aports_dev_image"
  tags: "aports-dev"
- file:
    mode: "755"
    path: "{{ item }}"
    state: "directory"
  loop:
  - "{{ ansible_user_dir }}/.abuild"
  - "{{ ansible_user_dir }}/packages"
  name: "podman | Create necessary bind-mount directories for aports-dev container"
  tags: "aports-dev"
- find:
    file_type: "file"
    paths:
    - "{{ ansible_user_dir }}/.abuild"
    patterns:
    - "*.rsa"
    recurse: false
  name: "podman | Check whether abuild-keygen has been run before"
  register: "abuild_key_found"
  tags: "aports-dev"
- containers.podman.podman_container:
    command:
    - "/usr/bin/abuild-keygen"
    - "-a"
    - "-n"
    entrypoint: ""
    gidmap:
    - "1069:0:1"
    - "0:1:1069"
    image: "{{ aports_dev_image.image[0].RepoDigests[0] }}"
    name: "abuild-keygen"
    rm: true
    uidmap:
    - "1069:0:1"
    - "0:1:1069"
    user: "1069"
    volume:
    - "{{ ansible_user_dir }}/.abuild:/home/builder/.abuild"
    - "{{ xdg_dir.config_home }}/git/config:/home/builder/.gitconfig"
  name: "podman | Run abuild-keygen"
  tags: "aports-dev"
  when: "abuild_key_found.matched == 0"
- name: "podman | Install aports-dev wrapper script"
  tags: "aports-dev"
  template:
    dest: "{{ xdg_dir.bin_home }}/aports-dev"
    mode: "755"
    src: "aports-dev.j2"
  vars:
    container_image_repo: "{{ aports_dev_image.image[0].RepoDigests[0] }}"
    podman_args: "--rm --tty --interactive --gidmap 1069:0:1 --gidmap 0:1:1069 --uidmap 1069:0:1 --uidmap 0:1:1069 --volume abuild-distfiles:/var/cache/distfiles --volume abuild-apkcache:/var/cache/apk --volume abuild-ccache:/home/builder/.ccache --volume {{ ansible_user_dir }}/.abuild:/home/builder/.abuild --volume {{ ansible_user_dir }}/packages:/home/builder/packages --volume {{ ansible_user_dir }}/Code/gitlab.alpinelinux.org/folliehiyuki/aports:/home/builder/aports"
- name: "podman | Install abuild wrapper script"
  tags: "aports-dev"
  template:
    dest: "{{ xdg_dir.bin_home }}/abuild"
    mode: "755"
    src: "abuild.j2"
  vars:
    container_image_repo: "{{ aports_dev_image.image[0].RepoDigests[0] }}"
    podman_args: "--rm --tty --interactive --gidmap 1069:0:1 --gidmap 0:1:1069 --uidmap 1069:0:1 --uidmap 0:1:1069 --volume abuild-distfiles:/var/cache/distfiles --volume abuild-apkcache:/var/cache/apk --volume abuild-ccache:/home/builder/.ccache --volume {{ ansible_user_dir }}/.abuild:/home/builder/.abuild --volume {{ ansible_user_dir }}/packages:/home/builder/packages --volume {{ ansible_user_dir }}/Code/gitlab.alpinelinux.org/folliehiyuki/aports:/home/builder/aports"
- containers.podman.podman_image:
    force: true
    name: "{{ vagrant_image_repository }}"
    tag: "{{ vagrant_image_tag }}"
  name: "podman | Keep vagrant container image up-to-date"
  tags: "vagrant"
  vars:
    vagrant_image_repository: "docker.io/vagrantlibvirt/vagrant-libvirt"
    vagrant_image_tag: "latest-slim"
- name: "podman | Install vagrant wrapper script"
  tags: "vagrant"
  template:
    dest: "{{ xdg_dir.bin_home }}/vagrant"
    mode: "755"
    src: "vagrant.j2"
  vars:
    vagrant_image_repository: "docker.io/vagrantlibvirt/vagrant-libvirt"
    vagrant_image_tag: "latest-slim"
- name: "podman | Create kcli shim"
  tags: "kcli"
  template:
    dest: "{{ xdg_dir.bin_home }}/kcli"
    mode: "755"
    src: "kcli.j2"
- file:
    dest: "{{ xdg_dir.bin_home }}/kweb"
    src: "./kcli"
    state: "link"
  name: "podman | Symlink kweb script to kcli"
  tags: "kcli"
