Might it be a good idea to include by default a snippet that sets the COBBLER_SERVER environment? Below is the snippet post_cobbler_env that I'm now using:
echo "export COBBLER_SERVER=@@server@@" > /etc/profile.d/cobbler.sh echo "setenv COBBLER_SERVER @@server@@" > /etc/profile.d/cobbler.csh
Regards, Peter
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Vreman, Peter - Acision wrote:
Might it be a good idea to include by default a snippet that sets the COBBLER_SERVER environment?
Below is the snippet post_cobbler_env that I’m now using:
echo "export COBBLER_SERVER=@@server@@" > /etc/profile.d/cobbler.sh
echo "setenv COBBLER_SERVER @@server@@" > /etc/profile.d/cobbler.csh
Regards,
Peter
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
Originally I had intended to create a configuration file for koan in %post, and have koan know to read it if it exists.
However, this seems to be a simpler way to do things, especially because the configuration file wouldn't be present on a system that did "yum install koan" and was not installed from cobbler.
I'll add this.
Thanks!
--Michael
I found that knowing about the variable @@server@@ is very useful. I can create yum.repos configuration files at the time of build that point to the cobbler server that you build from... Are these documented anywhere? I would like to know what other variables cobbler uses that I could also use.
For example one problem I am currently trying to solve is to define the variable in the kickstart file for the network device. Sometimes I use eth0 sometimes eth1. When I use koan for my rebuilds this needs to be set to the interface that koan used to connect to the cobbler server.. Currently I use ksmeta to define $iface in a profile for this and then pass that into the ks file, but I wonder if there is a magic cobbler variable that already sets this.
# Network information network --bootproto=dhcp --device=${iface} --onboot=on
Thanks,
Jolynn
From: cobbler-bounces@lists.fedorahosted.org [mailto:cobbler-bounces@lists.fedorahosted.org] On Behalf Of Vreman, Peter - Acision Sent: Wednesday, November 19, 2008 5:23 AM To: cobbler@lists.fedorahosted.org Subject: cobbler_server environment snippet
Might it be a good idea to include by default a snippet that sets the COBBLER_SERVER environment? Below is the snippet post_cobbler_env that I'm now using:
echo "export COBBLER_SERVER=@@server@@" > /etc/profile.d/cobbler.sh echo "setenv COBBLER_SERVER @@server@@" > /etc/profile.d/cobbler.csh
Regards, Peter
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
________________________________ This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
Jolynn Schmidt wrote:
I found that knowing about the variable @@server@@ is very useful. I can create yum.repos configuration files at the time of build that point to the cobbler server that you build from… Are these documented anywhere? I would like to know what other variables cobbler uses that I could also use.
For example one problem I am currently trying to solve is to define the variable in the kickstart file for the network device. Sometimes I use eth0 sometimes eth1. When I use koan for my rebuilds this needs to be set to the interface that koan used to connect to the cobbler server.. Currently I use ksmeta to define $iface in a profile for this and then pass that into the ks file, but I wonder if there is a magic cobbler variable that already sets this.
The development branch already has some nice network configuration snippets that auto generate this (thanks go to Jasper Capel). We're testing them now -- I originally said the release would be Friday, it /might/ be next week, though it will definitely be soon.
As for listing all of the variables you can use, "cobbler profile dumpvars --name=foo" or "cobbler system dumpvars --name=bar" will show them. The interface structure is accessible as a hash through Cheetah, so $interfaces["mac_address"] will work, etc. See the 1.3 development branch snippets for further examples, and they'll be coming to the sample kickstarts in the next release very soon.
--Michael
# Network information
network --bootproto=dhcp --device=${iface} --onboot=on
Thanks,
Jolynn
*From:* cobbler-bounces@lists.fedorahosted.org [mailto:cobbler-bounces@lists.fedorahosted.org] *On Behalf Of *Vreman, Peter - Acision *Sent:* Wednesday, November 19, 2008 5:23 AM *To:* cobbler@lists.fedorahosted.org *Subject:* cobbler_server environment snippet
Might it be a good idea to include by default a snippet that sets the COBBLER_SERVER environment?
Below is the snippet post_cobbler_env that I’m now using:
echo "export COBBLER_SERVER=@@server@@" > /etc/profile.d/cobbler.sh
echo "setenv COBBLER_SERVER @@server@@" > /etc/profile.d/cobbler.csh
Regards,
Peter
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
-----Original Message----- From: cobbler-bounces@lists.fedorahosted.org [mailto:cobbler- bounces@lists.fedorahosted.org] On Behalf Of Michael DeHaan Sent: woensdag 10 december 2008 15:13 To: cobbler mailing list Subject: Re: cobbler_server environment snippet
Jolynn Schmidt wrote:
I found that knowing about the variable @@server@@ is very useful. I can create yum.repos configuration files at the time of build that point to the cobbler server that you build from... Are these documented anywhere? I would like to know what other variables cobbler uses that I could also use.
For example one problem I am currently trying to solve is to define the variable in the kickstart file for the network device. Sometimes I use eth0 sometimes eth1. When I use koan for my rebuilds this needs to be set to the interface that koan used to connect to the cobbler server.. Currently I use ksmeta to define $iface in a profile for this and then pass that into the ks file, but I wonder if there is a magic cobbler variable that already sets this.
The development branch already has some nice network configuration snippets that auto generate this (thanks go to Jasper Capel). We're testing them now -- I originally said the release would be Friday, it /might/ be next week, though it will definitely be soon.
As for listing all of the variables you can use, "cobbler profile dumpvars --name=foo" or "cobbler system dumpvars --name=bar" will show them. The interface structure is accessible as a hash through Cheetah, so $interfaces["mac_address"] will work, etc. See the 1.3 development branch snippets for further examples, and they'll be coming to the sample kickstarts in the next release very soon.
Below is the snippet post_cobbler_env that I'm now using:
echo "export COBBLER_SERVER=@@server@@" > /etc/profile.d/cobbler.sh
echo "setenv COBBLER_SERVER @@server@@" > /etc/profile.d/cobbler.csh
Is there a reason why the macro is @@server@@ is using @@ instead of the $'s that are used in all other macro's? E.g. the @@server@@ could become $cobbler_server:$cobbler_ro_port to be consistent.
Peter
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Vreman, Peter - Acision wrote:
-----Original Message----- From: cobbler-bounces@lists.fedorahosted.org [mailto:cobbler- bounces@lists.fedorahosted.org] On Behalf Of Michael DeHaan Sent: woensdag 10 december 2008 15:13 To: cobbler mailing list Subject: Re: cobbler_server environment snippet
Jolynn Schmidt wrote:
I found that knowing about the variable @@server@@ is very useful. I can create yum.repos configuration files at the time of build that point to the cobbler server that you build from... Are these documented anywhere? I would like to know what other variables cobbler uses that I could also use.
For example one problem I am currently trying to solve is to define the variable in the kickstart file for the network device. Sometimes I use eth0 sometimes eth1. When I use koan for my rebuilds this needs to be set to the interface that koan used to connect to the cobbler server.. Currently I use ksmeta to define $iface in a profile for this and then pass that into the ks file, but I wonder if there is a magic cobbler variable that already sets this.
The development branch already has some nice network configuration snippets that auto generate this (thanks go to Jasper Capel). We're testing them now -- I originally said the release would be Friday, it /might/ be next week, though it will definitely be soon.
As for listing all of the variables you can use, "cobbler profile dumpvars --name=foo" or "cobbler system dumpvars --name=bar" will show them. The interface structure is accessible as a hash through Cheetah, so $interfaces["mac_address"] will work, etc. See the 1.3 development branch snippets for further examples, and they'll be coming to the sample kickstarts in the next release very soon.
Below is the snippet post_cobbler_env that I'm now using:
echo "export COBBLER_SERVER=@@server@@" > /etc/profile.d/cobbler.sh
echo "setenv COBBLER_SERVER @@server@@" > /etc/profile.d/cobbler.csh
Is there a reason why the macro is @@server@@ is using @@ instead of the $'s that are used in all other macro's? E.g. the @@server@@ could become $cobbler_server:$cobbler_ro_port to be consistent.
Peter
It's a bit of a weird reason, but there's a reason. This may be a bit confusing but I'll elaborate:
In the case of cobbler import we expand the variable "$tree" in the kickstart. The problem is the output of this expansion needs to include a variable in order to allow the cobbler --server-override parameter to work (and indeed, in order to allow cobbler replicate to work). Running Cheetah twice on the same file would be a trainwreck as it would evaluate bash as Cheetah even if included in #raw blocks, so instead we choose another variable substitution and do this manually just after the Cheetah run.
So our templating engine is Cheetah /plus/ a bit more, rather than just running Cheetah twice.
For things that do not involve double substitution, using "$foo" works fine, and everyone else should just use $foo. @@foo@@ should be reserved for Cobbler internals and that weird case above.
Basically if a variable is to be expanded and also needs to be saved in a cobbler object /unexpanded/, this is where the "@@" stuff comes in. I could have chosen any other syntax, it's just that syntax was sufficiently weird it would not be an escaping problem.
--Michael
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
Is there a reason why the macro is @@server@@ is using @@ instead of the
$'s that are used in all other macro's? E.g. the @@server@@ could become $cobbler_server:$cobbler_ro_port to be consistent.
It's a bit of a weird reason, but there's a reason. This may be a bit confusing but I'll elaborate:
In the case of cobbler import we expand the variable "$tree" in the kickstart. The problem is the output of this expansion needs to include a variable in order to allow the cobbler --server-override parameter to work (and indeed, in order to allow cobbler replicate to work). Running Cheetah twice on the same file would be a trainwreck as it would evaluate bash as Cheetah even if included in #raw blocks, so instead we choose another variable substitution and do this manually just after the Cheetah run.
So our templating engine is Cheetah /plus/ a bit more, rather than just running Cheetah twice.
For things that do not involve double substitution, using "$foo" works fine, and everyone else should just use $foo. @@foo@@ should be reserved for Cobbler internals and that weird case above.
Basically if a variable is to be expanded and also needs to be saved in a cobbler object /unexpanded/, this is where the "@@" stuff comes in. I could have chosen any other syntax, it's just that syntax was sufficiently weird it would not be an escaping problem.
Understand, maybe it good to add this explanation and a list of internal @@-variables to the KickstartTemplating page.
Peter
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
cobbler@lists.fedorahosted.org