Snippet

Latest response

I have snippet which create script to run in post configuration, I want to add satellite user in that script

i.e
cat > /root/join_realm.sh << EOF

!/bin/bash

realm join --user=SATELLITE-USER
--computer-ou=OU=OU_LINUX-GENERAL,OU=OU_Servers,DC=XXXX-,DC=ITSA,DC=YYYY,DC=YYYY zzz.zzz.zzz.zzzz --verbose

I tried to look in A.3. Satellite Specific Functions and Variables all found @host /os related variables and functions

Regards

Muhammad Mughal's picture

Responses

Muhammad,

I don't quite understand what you are trying to do. If I understand correctly, you want to specify a specific Satellite user, to be used when joining a host to a specific realm. Why are you insisting on a Satellite user? There is only one default Satellite user, admin, but as that account has complete access and authority within Satellite, you should not use that user.

Hi Russel,

I am looking for use user who logins to Satellite Server, I am deploying VM who needs to join realm join (LDAP) with his credentials

Hello,

Satellite 6 templating engine runs in safe-mode where you allowed only to subset of variables and methods for security reasons. You can access owner using this syntax:

<%= @host.owner =>

This should render to owner name, if not then each host owner has id, login, email and few more fields, example:

<%= @host.owner.login =>

You may need to turn off safemode for this method and file RFE to include this method in safe-mode in the future version.

Sidenote: You cannot reach to accounts password as this is hashed in the database for INTERNAL type of accounts, or not even stored in Satellite 6 for LDAP.

Tip: You can test the ERB syntax in console mode:

# foreman-rake console
> Host.where(name: "joan-jacoby.home.lan").first.owner
=> #<User:0x00560ff866d6f0
 id: 4,
 login: "admin",
 firstname: "Admin",
 lastname: "User",
 mail: "root@brq.redhat.com",
 admin: true,
 last_login_on: Mon, 18 Dec 2017 12:06:21 UTC +00:00,
 auth_source_id: 1,
 created_at: Thu, 01 Jun 2017 10:13:01 UTC +00:00,
 updated_at: Thu, 01 Jun 2017 10:14:14 UTC +00:00,
 password_hash: "38a7c6088e13799b4dd70d76e2bfeb5720ea360e",
 password_salt: "4852ef8b3e0388852f19e283af278b8a3c6327e5",
 locale: nil,
 avatar_hash: nil,
 default_organization_id: nil,
 default_location_id: nil,
 lower_login: "admin",
 mail_enabled: true,
 timezone: nil,
 description: nil>

Hi Lukas,

What are the side effects if we turn off safe mode (functional and security wise), does it will effect upgrade

Regards

Was this helpful?

We appreciate your feedback. Leave a comment if you would like to provide more detail.
It looks like we have some work to do. Leave a comment to let us know how we could improve.
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.