<div dir="ltr">Hello,<div><br></div><div>thanks for bringing up this topic, that's what I wanted to discuss on next puppet-openstack irc meeting.</div><div><br></div><div>So, user case is following: users may want to install Debian packages on Ubuntu host or vice versa,</div><div>the same problem can probably happen with CentOS, RHEL, Fedora; or users may use non-official</div><div>package repositories with their own package (service) naming strategy and so on.</div><div>Current situation in puppet modules is following that package and service names are (let's say)</div><div>hardcoded in 'params' class (e.g. [0]). But in situation that I've described it won't work.</div><div>Puppet will try to use Ubuntu names on Ubuntu host and it won't allow to install and work with</div><div>Debian packages.</div><div><br></div><div>I've researched puppet modules and found an interesting example which can help to solve</div><div>this issue. It's implemented in puppetlabs mongodb module:</div><div>they have 'globals' class [1] that allows to override most part of parameters from 'params' class [2].</div><div><br></div><div>So, I've decided to rework this soltuion and use it in OpenStack modules. As result I got draft patch</div><div>for ceilometer module [3]. By default we use parameters from 'params' class, but every parameter</div><div>can be now overridden using 'globals' class.</div><div><br></div><div>OpenStack Puppet team, what do you think about this solution?</div><div><br></div><div>Also, I'l bring up this topic on weekly puppet-openstack irc meeting.</div><div><br></div><div>[0] - <a href="https://github.com/openstack/puppet-ceilometer/blob/master/manifests/params.pp">https://github.com/openstack/puppet-ceilometer/blob/master/manifests/params.pp</a></div><div>[1] - <a href="https://github.com/puppetlabs/puppetlabs-mongodb/blob/master/manifests/globals.pp">https://github.com/puppetlabs/puppetlabs-mongodb/blob/master/manifests/globals.pp</a></div><div>[2] - <a href="https://github.com/puppetlabs/puppetlabs-mongodb/blob/master/manifests/params.pp">https://github.com/puppetlabs/puppetlabs-mongodb/blob/master/manifests/params.pp</a></div><div>[3] - <a href="https://review.openstack.org/#/c/229918/">https://review.openstack.org/#/c/229918/</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-02 15:43 GMT+03:00 Ivan Udovichenko <span dir="ltr"><<a href="mailto:iudovichenko@mirantis.com" target="_blank">iudovichenko@mirantis.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<span class=""><br>
On 10/02/2015 03:15 PM, Emilien Macchi wrote:<br>
> Hey Thomas,<br>
><br>
> On 10/02/2015 04:33 AM, Thomas Goirand wrote:<br>
> [...]<br>
>> We also may need, at some point, to add the type mosdebian and moscentos<br>
>> to the list of supported package suite, as there still will be some<br>
>> differences between the upstream Debian or CentOS packages. What is the<br>
>> best way to add this variable values?<br>
>><br>
>> Could you Puppet experts explain to me and my Mirantis colleagues again?<br>
><br>
> So we partially discussed about that during our last weekly meeting [1]<br>
> and it come out the best way to support both Debian & Ubuntu are Puppet<br>
> conditionals, like we already have in place.<br>
><br>
> [1]<br>
> <a href="http://eavesdrop.openstack.org/meetings/puppet_openstack/2015/puppet_openstack.2015-09-29-15.00.html" rel="noreferrer" target="_blank">http://eavesdrop.openstack.org/meetings/puppet_openstack/2015/puppet_openstack.2015-09-29-15.00.html</a><br>
<br>
</span>It does not solve the original problem. Let's say you want to install<br>
Debian packages on-top of Ubuntu, it will fail and you will have to use<br>
workarounds, for example in the params.pp [1] you have specified.<br>
<br>
[1]<br>
<a href="https://github.com/openstack/puppet-nova/blob/master/manifests/params.pp#L100-L107" rel="noreferrer" target="_blank">https://github.com/openstack/puppet-nova/blob/master/manifests/params.pp#L100-L107</a><br>
<span class=""><br>
><br>
> See the example with puppet-nova |2] where we use $::operatingsystem<br>
> fact [3] to detect if we're running Ubuntu or Debian.<br>
> If we're running Ubuntu, we take reference from UCA packaging. If<br>
> Debian, we take your work as reference.<br>
><br>
> [2]<br>
> <a href="https://github.com/openstack/puppet-nova/blob/master/manifests/params.pp#L100-L107" rel="noreferrer" target="_blank">https://github.com/openstack/puppet-nova/blob/master/manifests/params.pp#L100-L107</a><br>
> [3] <a href="https://puppetlabs.com/facter" rel="noreferrer" target="_blank">https://puppetlabs.com/facter</a><br>
><br>
<br>
</span>What we need is some variable which can override the decision which<br>
Operating System is used and thereby required packages will be<br>
installed. At least for Debian, that is what we really need.<br>
I'd be grateful if you look into it. Thank you.<br>
<span class="im HOEnZb"><br>
><br>
>> Sorry that I didn't take notes about it and couldn't explain,<br>
>> Cheers,<br>
>><br>
>> Thomas Goirand (zigo)<br>
>><br>
>> P.S: Where may I find the best tutorial to get up-to-speed about puppet,<br>
>> so that I know what I'm talking about next time?<br>
>><br>
><br>
> I personally learnt (and am still learning) by using official<br>
> documentation [4], that I suggest you to start with.<br>
><br>
> [4] <a href="http://docs.puppetlabs.com/puppet/" rel="noreferrer" target="_blank">http://docs.puppetlabs.com/puppet/</a><br>
><br>
> Hope it helps,<br>
><br>
><br>
><br>
</span><div class="HOEnZb"><div class="h5">> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font face="verdana, sans-serif">Thanks, Ivan Berezovskiy</font><div><font face="verdana, sans-serif">MOS Puppet Team Lead</font></div><div><font face="verdana, sans-serif">at <a href="https://www.mirantis.com/" target="_blank">Mirantis</a></font></div><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">slack: iberezovskiy</font></div><div><font face="verdana, sans-serif">skype: bouhforever</font></div><div><font face="verdana, sans-serif">phone: + 7-960-343-42-46</font></div><div><font face="verdana, sans-serif"><br></font></div></div></div></div></div>
</div>