myllynen / rhel-image Goto Github PK
View Code? Open in Web Editor NEWAnsible role for RHEL Image Builder
Ansible role for RHEL Image Builder
▶ cat roles/requirements.yml
---
roles:
- src: https://github.com/ikke-t/rhel-image.git
type: git
version: version
src/redhatnordicssa/cool-lab roles ✗ 24m ◒
▶ ansible-galaxy role install -r roles/requirements.yml -p roles
[WARNING]: - rhel-image was NOT installed successfully: this role does not appear to have a meta/main.yml file.
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
I tried running this on my laptop and was surpriced it waned reboot. That was due creating dummy user. That should not cause reboot. Probably none of these really:
builder_packages is changed or
package_update is changed or
builder_socket is changed or
builder_user is changed
perhaps just moving (re)start of osbuild-composer.socket osbuild-composer.service osbuild-local-worker.socket
to handler if install/update event happened.
I am building an RHEL 8.7 image on an AWS build host. After the first successful run, if I want to build an image again, I get this error:
TASK [Push image blueprint to osbuilder] ***************************************
task path: /root/.ansible/pull/ip-.ec2.internal/build_image.yml:13
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["composer-cli", "blueprints", "push", "base-image.toml"], "delta": "0:00:01.243122", "end": "2023-04-07", "msg": "non-zero return code", "rc": 1, "start": "2023-04-07*", "stderr": "ERROR: Push TOML: Post "http://localhost/api/v1/blueprints/new\": read unix @->/run/weldr/api.socket: read: connection reset by peer", "stderr_lines": ["ERROR: Push TOML: Post "http://localhost/api/v1/blueprints/new": read unix @->/run/weldr/api.socket: read: connection reset by peer"],"stdout": "", "stdout_lines": []}
Well, if I run these commands below or reboot the ec2 instance, I can successfully create another image again.
I wonder why it's happening because I can see that builder_uninstall.yml is cleaning up the previous image-builder stuff.
It's not a big issue, as I can still get the job done but would be nice if I could take care of it programmatically. I have tried several things but nothing seems to work.
I changed the below parameters in the playbook and used ansible pull to run the playbook but the image does not get created in /tmp/images:
rhel_image_git_remote_repo: https://gitlab.com/myblueprints.git
rhel_image_output_type: ami
There is no error in the ansible run
I started having this issue recently, using the latest code from this repo. My blueprint file is also pretty basic. Not sure what's going to resolve this.
TASK [Download image from osbuilder] *******************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["composer-cli", "compose", "image", "4c15ab13-f48d-4ab2-a1b5-5c33f59b9a82"], "delta": "0:00:00.024304", "end": "2023-05-16 14:17:29.163723", "msg": "non-zero return code", "rc": 1, "start": "2023-05-16 14:17:29.139419", "stderr": "ERROR: BuildInWrongState: Build 4c15ab13-f48d-4ab2-a1b5-5c33f59b9a82 is in wrong state: RUNNING", "stderr_lines": ["ERROR: BuildInWrongState: Build 4c15ab13-f48d-4ab2-a1b5-5c33f59b9a82 is in wrong state: RUNNING"], "stdout": "", "stdout_lines": []}
PLAY RECAP *****************************************************************
Blueprint file:
name = "base-image"
description = "Base Image"
version = "2023.03.13"
distro = "rhel-87"
[customizations.kernel]
append = "no_timer_check console=hvc0 LANG=en_US.UTF-8 console=ttyS0,115200n8 elevator=noop net.ifnames=0 biosdevname=0"
[[customizations.filesystem]]
mountpoint = "/boot"
size = "1 GiB"
[[customizations.filesystem]]
mountpoint = "/"
size = "8 GiB"
[[customizations.filesystem]]
mountpoint = "/home"
size = "2 GiB"
[[customizations.filesystem]]
mountpoint = "/tmp"
size = "2 GiB"
[[customizations.filesystem]]
mountpoint = "/var"
size = "8 GiB"
[[customizations.filesystem]]
mountpoint = "/var/log"
size = "2 GiB"
[[customizations.filesystem]]
mountpoint = "/var/log/audit"
size = "2 GiB"
[[customizations.filesystem]]
mountpoint = "/var/tmp"
size = "2 GiB"
[customizations.timezone]
timezone = "America/New_York"
[[groups]]
name="Minimal Install"
[[customizations.user]]
name = "ec2-user"
groups = ["wheel"]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.