How to use minion hostname<ß

17 views
Skip to first unread message

di...@laurenz.ws

unread,
May 12, 2022, 11:59:52 AM5/12/22
to salt-...@googlegroups.com

I’m a little bit stuck with this…

 

{% set node_name = salt['grains.get']('nodename', '') %}

 

local_hosts:

  host-present:

    - ip: 127.0.1.1

    - names:

      - {{ node_name }}.f.q.d.n

      - {{ node_name }}

 

I get no function declared….

 

What am I doing wrong?

 

Regards,

 

Dirk

 

Raf Czlonka

unread,
May 12, 2022, 1:29:48 PM5/12/22
to salt-...@googlegroups.com, di...@laurenz.ws
Hi Dirk,

On Thu, May 12, 2022 at 04:59:44PM BST, di...@laurenz.ws wrote:
> I’m a little bit stuck with this…
>
>
>
> {% set node_name = salt['grains.get']('nodename', '') %}
>
>
>
> local_hosts:
>
> host-present:
^
Start by replacing the dash ('-') with a dot ('.') here.

>
> - ip: 127.0.1.1
>
> - names:
>
> - {{ node_name }}.f.q.d.n
>
> - {{ node_name }}
>
>
>
> I get no function declared….
>
>
>
> What am I doing wrong?

Regards,

Raf

Subbarao a

unread,
May 12, 2022, 1:29:49 PM5/12/22
to salt-...@googlegroups.com
It is host.present not host-present .

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/049a01d86619%244c78cb70%24e56a6250%24%40laurenz.ws.

di...@laurenz.ws

unread,
May 13, 2022, 6:06:31 AM5/13/22
to Raf Czlonka, salt-...@googlegroups.com
Thanks....

> -----Ursprüngliche Nachricht-----
> Von: Raf Czlonka <rczl...@gmail.com>
> Gesendet: Donnerstag, 12. Mai 2022 18:16
> An: salt-...@googlegroups.com
> Cc: di...@laurenz.ws
> Betreff: Re: [salt-users] How to use minion hostname

di...@laurenz.ws

unread,
May 13, 2022, 6:09:26 AM5/13/22
to salt-...@googlegroups.com

Thanks, i was so into jinja, that I missed that….

 

Reply all
Reply to author
Forward
0 new messages