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 <[email protected]> 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 a sort() like this: {{ansible_play_batch | join(' ') | > sort()}}. > I'm not even sure why I need to add spaces after ansible_play_batch. > This is the command I am trying to translate to ansible. It is wrongly > running the command pn server "pcmk-2" instead of "pcmk-1". > Command: pcs cluster setup --name mycluster pcmk-1 pcmk-2 > > My Ansible: > - name: Setup message bus > run_once: true > command: > > pcs cluster setup --name {{ cluster_name | quote }} > {{ ansible_play_batch | join(' ') }} > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/88d03557-f5b4-4b9b-bd5a-946a2b971bd4%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/88d03557-f5b4-4b9b-bd5a-946a2b971bd4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Sent from a mobile device - please excuse the brevity, spelling and punctuation. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwPy1hHhoHGJc5SZSOgtochNwmMJC4MeZvoKwE8aGVGj0g%40mail.gmail.com.
