Posts

Showing posts from March, 2009

Python+Expect named.conf additions/removals

So i was getting tired of manually ssh'ing to the trio of name servers my company runs whenever we needed to add a new domain. I set out to script the process and ended up with this: Both expect scripts take a single argument, the domain to be added, be sure to modify the host part of the spawn ssh lines to fit your needs. The expect script run on the master for domain additions http://internetworkpro.org/pastebin/1213/ The Python script run by the expect script on the master: http://internetworkpro.org/pastebin/1218/ The Python script run by the expect script on the slaves: http://internetworkpro.org/pastebin/1217/ The expect script run on the master for domain deletions http://internetworkpro.org/pastebin/1214/ The Python script run by the expect script on all servers: http://internetworkpro.org/pastebin/1215/ The expect scripts assume you use public key authentication with ssh. These are some of my first attempts at python scripting and i'm not a seasoned expect/tcl guy eith