On Thu, 5 Sep 2019 at 16:49, Karther <
ryadmo...@gmail.com> 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