Commit graph

4 commits

Author SHA1 Message Date
Diaa Sami
ba5f49c592
Return error when write_files exists in cloud-init (#1644)
* Return error when write_files exists in cloud-init

Since the script adds a `write_files` key in cloud-init user-data, it
should return error if this key already exist in the input file.

Co-authored-by: Ondřej Budai <obudai@redhat.com>
2021-08-20 22:24:38 +02:00
Lars Karlitski
2f40265844 tools/gen-user-data: don't depend on python3-pyyaml
Instead, append `write_files: <JSON>` to the end of the file. This
works, because JSON is valid YAML.

For two reasons:

1. The generated user-data was hard to read, because python3-pyyaml
   outputs weird syntax. Keeping the file as written makes it easier to
   recognize when debugging an issue.

2. The tool now only depends on modules that python3 ships, making it
   easier to run on a pristine system.
2020-11-24 13:08:44 +01:00
Lars Karlitski
8161f2fa04 schutzbot: add repositories to be used by tests
Base these on https://osbuild.org/rpmrepo.

Install those repository files when deploying in schutzbot and include
them in tools/deploy/test for local testing.

Also remove copying overrides from deploy.sh, because it copied the
wrong files. We probably want to add this back properly in the future.
2020-10-16 09:37:04 +02:00
Lars Karlitski
857570980d tools: add deploy-qemu and gen-user-data
tools/gen-user-data generates a cloud-init user-data file from a
configuration directory. It is mostly useful to embed files in the
user-data.

tools/deploy-qemu uses above tool to make a user-data file and spins up
a virtual machine with it. This is useful to locally run, test, and
debug osbuild-composer.

A simple user-data directory for running tests locally is included in
tests/deploy-user-data. It expects a repository with osbuild-composer
rpms to be served on the host's port 8000.
2020-10-07 11:51:33 +02:00