Hi,
how many files are there? You are writing "This files have to be removed",
but you are testing only one file.
If it is only several files, maybe just delete them by file module like
this:
- name: Ensure example db do not exists
file: name={{ '/var/lib/ldap/' + item }} state=absent
with_items:
- DB_CONFIG.example
- DB_CONFIG.example1
...
?
David
2013/12/16 Marc Patermann <[email protected]>
> Hi,
>
> I'm building a playbook to install and configure openldap on SLES.
> The original openldap server installs an example db at /var/lib/ldap.
>
> This files have to be removed, before I can install my own db.
>
> What is the best way to delete the example db (once)?
>
> I tried with tasks like
>
> - name: check for example db
> shell: grep Example /var/lib/ldap/DB_CONFIG.example
> register: exampleDB
> ignore_errors: TRUE
>
> - name: delete example db
> shell: rm /var/lib/ldap/*
> when: exampleDB|success
>
> This works. "delete example db" is skipped, if there is no
> DB_CONFIG.example anymore.
>
> But I always get the "failed" for "check for example db" for the second
> (and further) run(s), which is why I have to ignore it.
> Is there any way to circumvent this?
>
>
> Marc
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
David Karban
Specialista na správu linuxových serverů
www.karban.eu
--
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].
For more options, visit https://groups.google.com/groups/opt_out.