Skip to content

Commit aa8b42b

Browse files
anjannathadrianriobo
authored andcommitted
fix setting username in cloud-config for snc profile
1 parent 8c5f13d commit aa8b42b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkg/provider/aws/action/rhel/cloud-config-snc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ runcmd:
2121
- systemctl mask libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket
2222
- systemctl enable libvirtd
2323
- systemctl start --no-block libvirtd
24-
- usermod -a -G libvirt ${username}
24+
- usermod -a -G libvirt {{ .Username }}
2525
- echo "user.max_user_namespaces=28633" | tee -a /etc/sysctl.d/userns.conf
2626
- sysctl -p /etc/sysctl.d/userns.conf
27-
- dnf upgrade -y curl openssl
27+
- dnf upgrade -y curl openssl

pkg/provider/aws/action/rhel/rhel.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type Request struct {
5555
type userDataValues struct {
5656
SubscriptionUsername string
5757
SubscriptionPassword string
58+
Username string
5859
}
5960

6061
//go:embed cloud-config-base
@@ -272,7 +273,8 @@ func (r *Request) getUserdata() (pulumi.StringPtrInput, error) {
272273
userdata, err := file.Template(
273274
userDataValues{
274275
r.SubsUsername,
275-
r.SubsUserpass},
276+
r.SubsUserpass,
277+
amiUserDefault},
276278
resourcesUtil.GetResourceName(
277279
r.Prefix, awsRHELDedicatedID, "userdata"),
278280
templateConfig)

0 commit comments

Comments
 (0)