I don’t know why, but in my mind, notifying handlers was only to restart a 
service … now I can see the light!! :)

Although, this would not help if the db exists but is empty, you just help me 
understand how I can use and how useful “notify” can be !  

Thank you.

fred

On Nov 26, 2013, at 19:18 , David Karban <[email protected]> wrote:

> Hi,
> 
> you can use notify in create DB to create schema. That way, it will be called 
> only on db creation.
> 
> David
> Dne 26.11.2013 17:42 "Fred Badel" <[email protected]> napsal(a):
> Hello,
> 
> I have a playbook that create a mysql DB and import an empty schema:
> 
> - name: create DB
>   mysql_db: name={{ db_name }} state=present login_host=127.0.0.1 
> 
> - name: create schema
>   mysql_db: name={{ db_name }} state=import login_host=127.0.0.1 
> target=/create_tables.sql 
> 
> From what i could notice, the sql file is imported each time the playbook is 
> run ... (aka, the task is marked as changed each time I run the playbook)
> is this an expected behavior?
> does someone have a recommended way of using the import feature and run it 
> only once?
> 
> Thanks.
> 
> Fred
> 
> -- 
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> -- 
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to