Bug 1655862

Summary: Option to include username or custom settings in the blueprint
Product: Red Hat Enterprise Linux 8 Reporter: Ranjith Rajaram <rrajaram>
Component: cockpit-composerAssignee: Martin Pitt <mpitt>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact: Eliane Ramos Pereira <elpereir>
Priority: unspecified    
Version: 8.1CC: elpereir, xiaofwan
Target Milestone: rcKeywords: Rebase
Target Release: 8.1Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 20:43:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ranjith Rajaram 2018-12-04 06:19:55 UTC
Description of problem:

As per RHEL8 documentation [1], we prefer composer-gui over cli. When using composer-gui, qcow2 image creation is successful. VM boots successfully using the custom image but unfortunately no detail in documentation or an option in the composer-gui to include a username or add any custom settings.

Adding an option directly in qcow2.ks( /usr/share/lorax/composer/qcow2.ks) is reflected but this will affect all the builds

Example output

composer-cli blueprints show podman
name = "podman"
description = "demo test"
version = "0.0.2"
modules = []
groups = []

[[packages]]
name = "podman"
version = "0.10.1.3"

As per the uptream doc, user's can be included in the blueprint
https://weldr.io/lorax/lorax-composer.html

currently composer-gui only allows to select packages and build images. We need options to customize blueprints to include additional information

Version-Release number of selected component (if applicable):
lorax-templates-rhel-8.0-19.el8.noarch
lorax-28.14.16-1.el8.x86_64
lorax-composer-28.14.16-1.el8.x86_64
lorax-lmc-novirt-28.14.16-1.el8.x86_64
lorax-templates-generic-28.14.16-1.el8.x86_64
[root@localhost ~]# 


How reproducible:
Always

Steps to Reproduce:
1. Attempt to create a blueprint and to add a user
2.
3.

Actual results:

If you are creating a qcow2 image via composer-gui, there are no option to mention the custom username or configure sudo access for the user. Resulting qcow2 image cannot be used.

Expected results:

Option to include custom information like username, partition etc

Additional info:

[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8-beta/html/installing_and_deploying_rhel/building-custom-system-images-with-composer_graphical-installation

Comment 1 Ranjith Rajaram 2018-12-04 08:49:28 UTC
It seems to be possible from command line. Below worked. 

Add 

[[customizations.user]]
name = "admin"
description = "Administrator account"
password = "redhat"

to an blueprint file and use the below command

Example blueprint

name = "rhel8testcustomusername"
description = "test qcow2"
version = "0.0.2"
modules = []
groups = []

[[packages]]
name = "findutils"
version = "4.6.0"

[[customizations.user]]
name = "admin"
description = "Administrator account"
password = "redhat"


Execute the command

composer-cli blueprints push /root/blueprint.toml

USe this blueprint to create custom images. 

final-kickstart.ks file will have

user --name admin --plaintext --password "redhat" --gecos "Administrator account"

You can now login to the VM created using the blueprint.

Comment 2 Ranjith Rajaram 2018-12-04 08:55:24 UTC
Allowing images created via composer api server to be further customized using cloud-init would be a good thing. 

Is there any documentation in this regard ?

Comment 3 Martin Pitt 2019-04-01 12:47:04 UTC
This landed in upstream release 0.2.0.

Comment 5 Xiaofeng Wang 2019-06-07 13:18:12 UTC
Verified on cockpit-composer-1-1.el8

Comment 7 errata-xmlrpc 2019-11-05 20:43:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:3333