info:
  summary: Create a VM and a KankuFile using a vagrant image
  description: |+
               This KankuFile creates a VM based on dki tumbleweed with ext4.
               After booting it installs and configures kanku (dev mode).
               Then a KankuFile using the configured default box is created (`kanku init ...`).
               Last but not least `kanku up` is executed.


domain_name: vagrant
default_job: vagrant
login_user: root
login_pass: kankudai

jobs:
 vagrant:
  -
    use_module: Kanku::Handler::SetJobContext
  -
    use_module: Kanku::Handler::OBSCheck
    options:
      project: devel:kanku:images
      package: openSUSE-Tumbleweed-JeOS:ext4
      repository: images_tumbleweed
  -
    use_module: Kanku::Handler::ImageDownload
  -
    use_module: Kanku::Handler::CreateDomain
    options:
      memory: 6G
      vcpu: 4
      use_9p: 1
  -
    use_module: Kanku::Handler::PrepareSSH
  -
    use_module: Kanku::Handler::CopyProfile
  -
    use_module: Kanku::Handler::ExecuteCommandViaSSH
    options:
      commands:
        - zypper ar obs://devel:kanku:staging dks
        - zypper --gpg-auto-import-keys ref -s
        - zypper -n in kanku-cli qemu-spice
        - kanku setup devel --user kanku
        # END
        - "chown kanku -R /home/kanku/.ssh"
  -
    use_module: Kanku::Handler::ExecuteCommandViaSSH
    options:
      username: kanku
      commands:
        - 'ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""'
        - kanku init -T vagrant -d vagrant
        - chmod 755 $HOME
        - kanku up

notifiers:
  vagrant:
    -
      use_module: Kanku::Notifier::Console
      options:
        template: |+
          [% USE Filter::ANSIColor 'color' %]
          ****
          **** Currently (02/2025) the permanent upstream changes in
          **** the hashicorp infrastructur and Web API make it impossible to
          **** provide a stable, reliable and working Kankufile.
          ****
          **** [% "Please check again later." |color 'yellow' +%]
          ****
      states: failed
