Yes, I am tried use quotes, and this not working. пятница, 6 февраля 2015 г., 17:24:46 UTC+5 пользователь Igor Khomyakov написал: > > Hi Alexey, > > You do not need to quote a whole string here, could you try > > when: servers.role == "upstream" > > -- Best, Igor > > On Fri, Feb 6, 2015 at 2:27 PM, Alexey Lesovsky <[email protected] > <javascript:>> wrote: > > Hello all! > > I have playbook with following parts: > > > > vars: > > servers: > > - { address: "192.168.122.12", role: "upstream" } > > - { address: "192.168.122.13", role: "downstream" } > > - { address: "192.168.122.14", role: "downstream" } > > task: > > - name: Task > > command: "/usr/sbin/somecommand" > > > > How I can execute task only on upstream or downstream servers? Any help > > appreciated. > > > > P.S. I try following part, but it doesn't work: > > task: > > - name: Task > > command: "/usr/sbin/somecommand" > > when: "servers.role == upstream" > > > > And got error: > > fatal: [vm12-centos7] => error while evaluating conditional: > servers.role == > > upstream > > fatal: [vm13-centos7] => error while evaluating conditional: > servers.role == > > upstream > > fatal: [vm14-centos7] => error while evaluating conditional: > servers.role == > > upstream > > > > -- > > 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] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/ansible-project/49234d35-06db-4a7a-8929-9d23ea542f69%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. >
-- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/83185c0e-564f-40cb-b0d9-6d54aa4f76a2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
