Ansible "When" statement

0 votes

Hello,

With win_stat i can check if a path exists and then set a condition after

       win_stat:
              path: <some path>
       register: A

       win_robocopy:
             src: <>
             dest: <>
              flags: <>
        when: A.stat.exist

My question is, how to achieve this with win find?

       win_find:
             path: <>
         register: A

         debug:
             msg= all files are found
         when: (?)

Any help would be appreciated

Jun 7 in Ansible by Omar
• 120 points

recategorized Jun 7 by Kalgi 27 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Ansible

0 votes
1 answer

When conditional not working in Ansible

Your identation is wrong and when is ...READ MORE

answered Apr 27, 2018 in Ansible by ajs3033
• 7,120 points
529 views
0 votes
1 answer

Running ansible command on a single server when it is deployed to multiple servers

You can try the run_once attribute: Example from ...READ MORE

answered Jun 13, 2018 in Ansible by DareDev
• 6,710 points
107 views
0 votes
1 answer

Permission denied when running ansible playbook through jenkins

Jenkins uses it's own user to execute ...READ MORE

answered Jun 25, 2018 in Ansible by DareDev
• 6,710 points
513 views
0 votes
1 answer

stopping different hosts from reading the same value when usign ansible in loop

Try using this. Create a new directory ...READ MORE

answered Jul 27, 2018 in Ansible by DareDev
• 6,710 points
26 views
0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.