image:
  distribution: "altlinux"

source:
  downloader: alt-http
  url: https://mirror.yandex.ru/altlinux/images/
  keys:
  # 0x17F112840DE94827C9C109FD3E2B30EA57EF33CE
  - |-
    -----BEGIN PGP PUBLIC KEY BLOCK-----

    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
    =UJiI
    -----END PGP PUBLIC KEY BLOCK-----

targets:
  lxc:
    create_message: |
      You just created an {{ image.description }} container.

    config:
    - type: all
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/common.conf

    - type: user
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/userns.conf

    - type: all
      content: |-
        lxc.arch = {{ image.architecture_personality }}

files:
- path: /etc/hostname
  generator: hostname

- path: /etc/hosts
  generator: hosts

- path: /etc/systemd/network/eth0.network
  generator: dump
  content: |-
    [Match]
    Name=eth0

    [Network]
    DHCP=ipv4

    [DHCP]
    ClientIdentifier=mac
  variants:
  - default

- path: /etc/fstab
  generator: dump

- name: meta-data
  generator: cloud-init
  variants:
  - cloud

- name: network-config
  generator: cloud-init
  variants:
  - cloud

- name: user-data
  generator: cloud-init
  variants:
  - cloud

- name: vendor-data
  generator: cloud-init
  variants:
  - cloud

packages:
  manager: apt
  update: true
  cleanup: true

  sets:
  - packages:
    - sudo
    - vim-console
    action: install

  - packages:
    - cloud-init
    - cloud-init-config-netplan
    action: install
    variants:
    - cloud

actions:
- trigger: post-unpack
  action: |-
    #!/bin/sh
    set -eux

    mkdir -p /run/lock

- trigger: post-unpack
  action: |-
    #!/bin/sh
    set -eux

    apt-get update
    apt-get install usrmerge-hier-convert --yes

  releases:
   - Sisyphus

- trigger: post-packages
  action: |-
    #!/bin/sh
    set -eux

    rm -f /var/cache/apt/archives/*.rpm /var/cache/apt/*.bin /var/lib/apt/lists/*.*

- trigger: post-packages
  action: |-
    #!/bin/sh
    set -eux

    # Enable the cloud-init systemd service
    systemctl enable cloud-init.service cloud-config.service cloud-final.service

    # Remove this file as it will override the network renderers to only include
    # NetworkManager although we use netplan.
    rm -f /etc/cloud/cloud.cfg.d/01_network-manager.cfg
  variants:
  - cloud

mappings:
  architecture_map: altlinux
