Re: [ansible-project] run task in a sorted manner

2020-02-15 Thread Dick Visser
You only posted a single task. Please post your entire playbook. Also explain what your command should look like (it’s not clear what you posted is correct or not). On Sat, 15 Feb 2020 at 20:57, sandkan wrote: > Playbook is running task on wrong node: I have two nodes and this task has > to run

Re: [ansible-project] run task in a sorted manner

2020-02-15 Thread Nicholas Irving
Try just using {{ ansible_hostname }} it should give you the details you want. On Sun, 16 Feb 2020, 06:57 sandkan, wrote: > Playbook is running task on wrong node: I have two nodes and this task has > to run on a specific one and not the other, as well as only running once. > I have tried adding

[ansible-project] run task in a sorted manner

2020-02-15 Thread sandkan
Playbook is running task on wrong node: I have two nodes and this task has to run on a specific one and not the other, as well as only running once. I have tried adding a sort() like this: {{ansible_play_batch | join(' ') | sort()}}. I'm not even sure why I need to add spaces after ansible_play_b

Re: [ansible-project] Re: Get a value from a fact from type type

2020-02-15 Thread Stefan Hornburg (Racke)
On 2/15/20 6:44 PM, Seth Daemen wrote: > I already tried {{ hostUUid[0] }} gives also not the result I want. > that gives this in the debug: > It is indeed a dict within a list, so please try hostUUid[0].id Regards Racke > | > ok:[localhost]=>{ >     "msg":[ >         "list", >        

[ansible-project] Re: Get a value from a fact from type type

2020-02-15 Thread Seth Daemen
solved my issue. {{ hostUUid[0] }} is working. But I had to set: body_format: json in my uri Op zaterdag 15 februari 2020 18:44:04 UTC+1 schreef Seth Daemen: > > I already tried {{ hostUUid[0] }} gives also not the result I want. > that gives this in the debug: > > ok: [localhost] => { >

[ansible-project] Re: Get a value from a fact from type type

2020-02-15 Thread Seth Daemen
I already tried {{ hostUUid[0] }} gives also not the result I want. that gives this in the debug: ok: [localhost] => { "msg": [ "list", { "id": "7261c5626862-abafe49d9bac" } ] } the body now look like this: "body": "{\"environmentUuid\": \"7261c562686

Re: [ansible-project] Get a value from a fact from type type

2020-02-15 Thread Stefan Hornburg (Racke)
On 2/15/20 5:22 PM, Seth Daemen wrote: > > I have a fact hostUUid when I display it with the following debug command  > > | >   -name:debug uuid >     debug: >       msg: >         -"{{ hostUUid | type_debug }}"      >        -"{{ hostUUid }}" > | > > > > > I get the following result: > > |

[ansible-project] Get a value from a fact from type type

2020-02-15 Thread Seth Daemen
I have a fact hostUUid when I display it with the following debug command - name: debug uuid debug: msg: - "{{ hostUUid | type_debug }}" - "{{ hostUUid }}" I get the following result: ok: [localhost] => { "msg": [ "list", "[{u'id': u'7

Re: [ansible-project] Re: include_vars in folders

2020-02-15 Thread Vladimir Botka
On Sat, 15 Feb 2020 00:16:02 -0800 (PST) Eric Chang wrote: > so any suggesions to combine multiple yaml files with same attributes ? Sure. For example - set_fact: users: "{{ users| default({})| combine({my_key: my_value}) }}" vars:

[ansible-project] Re: include_vars in folders

2020-02-15 Thread Eric Chang
so any suggesions to combine multiple yaml files with same attributes ? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegrou