<div dir="ltr">That's an amazing tip, thank you!<div class="gmail_extra"><br><div class="gmail_quote">On 15 October 2016 at 07:27, Turbo Fredriksson <span dir="ltr"><<a href="mailto:turbo@bayour.com" target="_blank">turbo@bayour.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Oct 14, 2016, at 11:13 PM, Martinx - ジェームズ wrote:<br>
<br>
> Looks like that it requires fixed_ips! Why is that?<br>
<br>
</span>What version have you set for your stack?<br></blockquote><div><br></div><div>I was still using 2013-05-23 specs, lol...</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Part of my stack looks like:<br>
<br>
----- s n i p -----<br>
heat_template_version: 2016-04-08<br>
description: Instance template<br>
[..]<br>
resources:<br>
[..]<br>
<span class="gmail-">  port:<br>
    type: OS::Neutron::Port<br>
    properties:<br>
</span>      name: { get_param: name }<br>
      network: { get_param: network }<br>
      security_groups: { get_param: secgrps }<br>
----- s n i p -----<br>
<br>
And that works just fine - no need for fixed_ips.<br></blockquote><div><br></div><div>Awesome, it worked!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
>      name: {"Fn::Join": ["-", [{ get_param: "OS::stack_name" } ,<br>
> "instance-port-1"]]}<br>
<br>
</span>Hint: Use list_join instead..<br></blockquote><div><br></div><div>Good, working too...</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Oh, and just to 'blow your mind', this is one of my absolute<br>
"worst" :)<br>
<br>
----- s n i p -----<br>
  instance:<br>
    [create the instance using OS::Nova::Server]<br>
<br>
  record:<br>
    type: Turbo::Record<br>
    properties:<br>
      dnsname: { list_join:<br>
                   ['-', [<br>
                     { get_param: name },<br>
                     { str_split: ['.', { get_attr: [instance, first_address] }, 3] },<br>
                   ] ]<br>
                 }<br>
      dnsdomain: domain.tld.<br>
      data: { get_attr: [instance, first_address] }<br>
<br>
  reverse:<br>
    type: Turbo::Record<br>
    properties:<br>
      dnsname: { str_split: ['.', { get_attr: [instance, first_address] }, 3] }<br>
      dnsdomain: { list_join:<br>
                   ['.', [<br>
                     { str_split: ['.', { get_attr: [instance, first_address] }, 2] },<br>
                     { str_split: ['.', { get_attr: [instance, first_address] }, 1] },<br>
                     { str_split: ['.', { get_attr: [instance, first_address] }, 0] },<br>
                     'in-addr.arpa.'<br>
                   ] ]<br>
                 }<br>
      data: { list_join:<br>
                ['.', [<br>
                  { list_join:<br>
                    ['-', [<br>
                      { get_param: name },<br>
                      { str_split: ['.', { get_attr: [instance, first_address] }, 3] },<br>
                    ] ]<br>
                  },<br>
                  'domain.tld.'<br>
                ] ]<br>
            }<br>
      rec_type: PTR<br>
----- s n i p -----<br>
<br>
With 'Turbo::Record' defined as<br>
<br>
----- s n i p -----<br>
heat_template_version: 2016-04-08<br>
description: Designate domain record template<br>
<br>
parameters:<br>
  dnsdomain:<br>
    type: string<br>
    description: Domain name to attach dnsname to<br>
    default: domain.tld<br>
<br>
  dnsname:<br>
    type: string<br>
    description: Host name to attach to domain<br>
<br>
  data:<br>
    type: string<br>
    description: IP address to attach to IP<br>
<br>
  rec_type:<br>
    type: string<br>
    description: DNS record type<br>
    default: A<br>
<br>
resources:<br>
  record:<br>
    type: OS::Designate::Record<br>
    properties:<br>
      description: { list_join: [' - ', [ 'Floating IP DNS Record', { get_param: dnsname } ] ] }<br>
      name: { list_join: ['.', [ { get_param: dnsname }, { get_param: dnsdomain } ] ] }<br>
      domain: { get_param: dnsdomain }<br>
      data: { get_param: data }<br>
      type: { get_param: rec_type }<br>
----- s n i p -----<br>
<br>
I use it for creating a DNS record for the instance in Designate,<br>
because a auto scaling group doesn't have a "counter" ('%index%')<br>
like a resource group have..<br></blockquote><div><br></div><div>Hmmm... This is very interesting... I was expecting to use the %index% with AutoScaling but, now that you said it doesn't work, I'll definitely give Designate a try.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
--<br>
Choose a job you love, and you will never have<br>
to work a day in your life.</blockquote><div><br></div><div>Absolutely!</div><div><br></div><div>Cheers!</div><div>Thiago</div><div> </div></div></div></div>