<div dir="ltr">Thanks for the idea.<div style>As I don't like spreading scripts on clients with login/password, I'll try to do the same from the server (searching for systems without the custom key set, and setting it if empty)</div>
<div style><br></div><div style>Thanks</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/19 Jason M. Nielsen <span dir="ltr"><<a href="mailto:jnielsen@myriad.com" target="_blank">jnielsen@myriad.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Submit a custom system info variable back to the host profile and use that in the config file.  I have a bash script that runs during a build that generates the values for variables then submits them back with a python script.<br>

<br>
ie:<br>
<br>
#!/bin/bash<br>
/root/bin/submit_custom_<u></u>system_info.py hostname_short `hostname -s`<br>
...<br>
<br>
<br>
#!/usr/bin/python<br>
import xmlrpclib<br>
import getpass<br>
import sys<br>
from socket import gethostname<br>
<br>
SATELLITE_URL = "<a href="https://spacewalk.myriad.com/rpc/api" target="_blank">https://spacewalk.myriad.com/<u></u>rpc/api</a>"<br>
SATELLITE_LOGIN = "submitvar"<br>
SATELLITE_PASSWORD = "SubV@R1t"<br>
client = xmlrpclib.Server(SATELLITE_<u></u>URL, verbose=0)<br>
key = client.auth.login(SATELLITE_<u></u>LOGIN, SATELLITE_PASSWORD)<br>
<br>
fin = open('/etc/sysconfig/rhn/<u></u>systemid')<br>
file = list()<br>
for line in fin:<br>
  file.append(line)<br>
<br>
system_id = int(file[file.index('<name><u></u>system_id</name>\n')+1][18:28]<u></u>)<br>
<br>
field_name = sys.argv[1]<br>
field_value = sys.argv[2]<br>
print "%s: %s: %s\n" % (system_id,field_name,field_<u></u>value)<br>
client.system.setCustomValues(<u></u>key,system_id,{field_name: field_value})<br>
<br>
client.auth.logout(key)<div class="HOEnZb"><div class="h5"><br>
<br>
On 12/19/2012 12:38 AM, Pierre Casenove wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
I can't as I want to use the macro in some configuration files, where you<br>
can't put scripts in them<br>
<br>
Pierre<br>
<br>
<br>
2012/12/19 Jørgen Hysvær Langgåt <<a href="mailto:jorgenhl@gmail.com" target="_blank">jorgenhl@gmail.com</a>><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Dec 18, 2012 at 5:10 PM, Pierre Casenove <<a href="mailto:pcasenove@gmail.com" target="_blank">pcasenove@gmail.com</a>>wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello list,<br>
The RHN predefined macro rhn.system.hostname allows you to get the FQDN<br>
of a client.<br>
In order to manage the /etc/hosts file on some hosts, I would like to get<br>
the FQDN and the short name.<br>
How could I perform this?<br>
<br>
<br>
</blockquote>
How about "cut -d. -f 1" from the FQDN?<br>
<br>
Regards,<br>
Jørgen<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com" target="_blank">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/spacewalk-<u></u>list</a><br>
<br>
</blockquote>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com" target="_blank">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/spacewalk-<u></u>list</a><br>
<br>
</blockquote>
<br>
<br>
______________________________<u></u>_________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com" target="_blank">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/spacewalk-<u></u>list</a><br>
</div></div></blockquote></div><br></div>