On Thu, 5 Sep 2019 at 16:49, Karther <[email protected]> wrote: > > Hey ! > > I have problem when i use this command ansible-playbook playbook.yml --check > > All works normaly without --check but when there is one task who create > repertory, the second task is mistake. > > Exemple : > > - name: "Create repertory" > file: > path: /var/apps/my_repertory > state: directory > > - name: "Create file in my repertory" > file: > src: /home/wildfly/my_file > dest: /var/apps/my_repertory/my_file > > This tasks works perfectly without --check but when i use --check, the second > task is mistake because ansible not really create my repertory ....
Yes, that is how it's supposed to work. The second task is dependent on the first one, in this case only the first task can be used with --check. Getting a playbook to work properly with --check can be a tricky task, you'll have to look at the logic in detail. https://docs.ansible.com/ansible/latest/user_guide/playbooks_checkmode.html -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- 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/CAL8fbwPeHLkr018tQGTJ2y3cJrdsYhRMj1KpchMsO5bMsxcVKQ%40mail.gmail.com.
