Hi folks. I am pretty new to Ansible though have been assigned a project to 
failover a Microsoft SQL database from a primary data center to a DR site. 
What I an uncertain of is how to structure that's below in Ansible and 
execute the sql scripts remotely. Would anyone be able to help here? Would 
anyone have a module/modules to use to accomplish all of this?

//Stop application
-stop iis on servers a, b and c
-stop windows services on servers d, e, and f
-stop scheduled tasks on servers d, e, and f

//No pending transactions replicating
-execute a SQL script(to check if any replication is in flight) on DB 
server G
-if records in queue =0, continue. If query returns anything other than 0, 
wait 30 seconds and rerun the query. Needs to be 0 before continuing

//Stop log reader agent and drop publications and subscriptions
-execute SQL script on server G to stop log reader agent 
-execute SQL script on server G to drop replication publications 
-execute SQL script on server H to drop all replication subscriptions
-execute SQL script on server I to drop all replication subscriptions
-execute SQL script on server J to drop all replication subscriptions

//Failover Databases
-execute SQL script to failover databases from primary to dr

Configure replication
-execute SQL script on server G to create replication publications 
-execute SQL script on server H to create all replication subscriptions
-execute SQL script on server I to create all replication subscriptions
-execute SQL script on server J to create all replication subscriptions

Thank you in advance. 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2f9796cb-3d60-4e51-8f83-9b61a435e6bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to