<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body>
    Hi Andrew,<br>
    <br>
    Sorry for the delay in this answer<br>
    <br>
    <div class="moz-cite-prefix">On 07/30/2015 09:20 PM, Andrew Woodward
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACEfbZhBg++-e38NnT2Xgp9jF4ff1FCqis_9nwg7_k7yKXq9FQ@mail.gmail.com"
      type="cite">
      <pre wrap="">On Thu, Jul 30, 2015 at 3:36 AM Sebastien Badia <a class="moz-txt-link-rfc2396E" href="mailto:sbadia@redhat.com"><sbadia@redhat.com></a> wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">On Mon, Jul 27, 2015 at 09:43:28PM (+0000), Andrew Woodward wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Sorry, I forgot to finish this up and send it out.

#--SNIP--
def absent_default(
  $value,
  $default,
  $unset_when_default = true,
){
  if ( $value == $default ) and $unset_when_default {
    # I cant think of a way to deal with this in a define so lets pretend
    # we can re-use this with multiple providers like we could if this
</pre>
        </blockquote>
        <pre wrap="">was
</pre>
        <blockquote type="cite">
          <pre wrap="">    # in the actual provider.

    keystone_config {$name: ensure => absent,}
  } else {
    keystone_config {$name: value = $value,}
  }
}

# Usage:
absent_default{'DEFAULT/foo': default => 'bar', value => $foo }
</pre>
        </blockquote>
        <pre wrap="">
Hi,

Hum, but you want to add this definition in all our modules, or directly in
openstacklib?

</pre>
      </blockquote>
      <pre wrap="">
I only mocked it up in a puppet define, because its easier for me (my ruby
is terrible) It should be done by adding these kinds of extra providers to
the inifile provider override that Yanis proposed.


</pre>
      <blockquote type="cite">
        <pre wrap="">
In case of openstacklib, in which manner do you define the
<component>_config
resource? (eg, generic def, but specialized resource).

</pre>
        <blockquote type="cite">
          <pre wrap="">#--SNIP--

(I threw this together and haven't tried to run it yet, so It might not
</pre>
        </blockquote>
        <pre wrap="">run
</pre>
        <blockquote type="cite">
          <pre wrap="">verbatim, I will create a test project with it to show it working)

So In the long-term we should be able to add some new functionality to
</pre>
        </blockquote>
        <pre wrap="">the
</pre>
        <blockquote type="cite">
          <pre wrap="">inifile provider to simply just do this for us. We can add the 'default'
and 'unset_when_default' parameter so that we can use them straight w/o a
wrapping function (but the warping function could be used too). This
</pre>
        </blockquote>
        <pre wrap="">would
</pre>
        <blockquote type="cite">
          <pre wrap="">give us the defaults (I have an idea on that too that I will try to put
into the prototype) that should allow us to have something that looks
</pre>
        </blockquote>
        <pre wrap="">quite
</pre>
        <blockquote type="cite">
          <pre wrap="">clean, but is highly functional

</pre>
          <blockquote type="cite">
            <pre wrap="">Keystone_config{unset_when_default => true} #probably flatly enabled in
</pre>
          </blockquote>
          <pre wrap="">our inifile provider for the module
</pre>
          <blockquote type="cite">
            <pre wrap="">keystone_config {'DEFAULT/foo': value => 'bar', default => 'bar'}
</pre>
          </blockquote>
        </blockquote>
        <pre wrap="">

I'm not sure to see the difference with the Yanis solution here¹, and not
sure
to see the link between the define resource and the type/provider resource.

</pre>
      </blockquote>
      <pre wrap="">
This adds on to Yanis' solution so that we can authoritatively understand
what the default value is, and how it should be treated (instead of hoping
some magic word doesn't conflict)</pre>
    </blockquote>
    So I think we agree on most points here. '<SERVICE DEFAULT>'
    value has been chosen based on our weekly meetings two weeks ago but
    it remains customizable (via the ensure_absent_val parameter).<br>
    <br>
    We need an explicit one by default so it can be set as a default
    value in all manifests.<br>
    <br>
    We mainly picked that value because we thought it was the less
    likely to be used as a valid value in any OpenStack related
    component configuration file.<br>
    <br>
    If by any chance it turns out to be a valid value for a parameter,
    we can use the temporary fix of changing ensure_absent_val for this
    specific parameter and raise the point during a meeting.<br>
    <br>
    I take the point to make it clear in the README that if a X_config
    resource has as a value set to '<SERVICE DEFAULT>' it will
    ensure absent on the resource.<br>
    <br>
    Does that sound good with you ?<br>
    <br>
    <blockquote
cite="mid:CACEfbZhBg++-e38NnT2Xgp9jF4ff1FCqis_9nwg7_k7yKXq9FQ@mail.gmail.com"
      type="cite">
      <pre wrap="">

Seb
</pre>
      <blockquote type="cite">
        <pre wrap="">
¹<a class="moz-txt-link-freetext" href="https://review.openstack.org/#/c/202574/">https://review.openstack.org/#/c/202574/</a>
--
Sebastien Badia
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>

</pre>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></pre>
      </blockquote>
    </blockquote>
    <br>
    --<br>
    Yanis Guenane<br>
    <blockquote
cite="mid:CACEfbZhBg++-e38NnT2Xgp9jF4ff1FCqis_9nwg7_k7yKXq9FQ@mail.gmail.com"
      type="cite">
      <blockquote type="cite">
        <pre wrap="">
</pre>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>