Devesh's changes to request router models and observer
diff --git a/planetstack/rr_observer/playbook/roles/delete_demux/handlers/main.yml b/planetstack/rr_observer/playbook/roles/delete_demux/handlers/main.yml
new file mode 100644
index 0000000..a888468
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/delete_demux/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart dnsdemux
+ service: name=dnsdemux state=restarted
diff --git a/planetstack/rr_observer/playbook/roles/delete_demux/tasks/main.yml b/planetstack/rr_observer/playbook/roles/delete_demux/tasks/main.yml
new file mode 100644
index 0000000..417401a
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/delete_demux/tasks/main.yml
@@ -0,0 +1,5 @@
+---
+# This playbook contains plays to delete configuration files from dnsdemux slice
+- name: delete dnsdemux config files
+ file: path={{dst_dnsdemux_conf}}/{{name}}.conf state=absent
+ notify: restart dnsdemux
diff --git a/planetstack/rr_observer/playbook/roles/delete_demux/vars/main.yml b/planetstack/rr_observer/playbook/roles/delete_demux/vars/main.yml
new file mode 100644
index 0000000..b457050
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/delete_demux/vars/main.yml
@@ -0,0 +1,6 @@
+---
+# Variables listed here are applicable to all host groups
+
+src_dnsdemux: ../../../../temp_config/dnsdemux
+dst_dnsdemux_conf: /etc/dnsdemux/default/
+
diff --git a/planetstack/rr_observer/playbook/roles/delete_redir/handlers/main.yml b/planetstack/rr_observer/playbook/roles/delete_redir/handlers/main.yml
new file mode 100644
index 0000000..8aa497e
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/delete_redir/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart dnsredir
+ service: name=dnsredir state=restarted
diff --git a/planetstack/rr_observer/playbook/roles/delete_redir/tasks/main.yml b/planetstack/rr_observer/playbook/roles/delete_redir/tasks/main.yml
new file mode 100644
index 0000000..58833bb
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/delete_redir/tasks/main.yml
@@ -0,0 +1,13 @@
+---
+# This playbook contains plays to delete configuration files from dnsredir slice
+- name: delete maps.d directory ( and deletes all intermeadiate directories )
+ #copy: src={{src_dnsredir}}/{{name}}.d dest={{dst_dnsredir_confdir}}
+ file: path={{dst_dnsredir_confdir}}/{{name}}.d/maps.d state=absent
+
+- name: delete config directory
+ file: path={{dst_dnsredir_confdir}}/{{name}}.d/ state=absent
+
+- name: copy dnsredir config file
+ file: path={{dst_dnsredir_conf}}/{{name}}.conf state=absent
+ notify: restart dnsredir
+
diff --git a/planetstack/rr_observer/playbook/roles/delete_redir/vars/main.yml b/planetstack/rr_observer/playbook/roles/delete_redir/vars/main.yml
new file mode 100644
index 0000000..dc79d35
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/delete_redir/vars/main.yml
@@ -0,0 +1,6 @@
+---
+# Variables listed here are applicable to all host groups
+
+src_dnsredir: ../../../../temp_config/dnsredir
+dst_dnsredir_conf: /etc/dnsredir/conf.d/
+dst_dnsredir_confdir: /etc/dnsredir
diff --git a/planetstack/rr_observer/playbook/roles/demux/handlers/main.yml b/planetstack/rr_observer/playbook/roles/demux/handlers/main.yml
new file mode 100644
index 0000000..a888468
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/demux/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart dnsdemux
+ service: name=dnsdemux state=restarted
diff --git a/planetstack/rr_observer/playbook/roles/demux/tasks/main.yml b/planetstack/rr_observer/playbook/roles/demux/tasks/main.yml
new file mode 100644
index 0000000..0339aed
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/demux/tasks/main.yml
@@ -0,0 +1,9 @@
+---
+# This playbook contains plays to copy configurations to destination
+- name: copy dnsdemux config files
+ copy: src={{src_dnsdemux}}/{{name}}.conf dest={{dst_dnsdemux_conf}}/{{name}}.conf
+ notify: restart dnsdemux
+
+#- name: Start the dnsdemux service
+ #service: name=dnsdemux state=started enabled=true
+
diff --git a/planetstack/rr_observer/playbook/roles/demux/vars/main.yml b/planetstack/rr_observer/playbook/roles/demux/vars/main.yml
new file mode 100644
index 0000000..b457050
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/demux/vars/main.yml
@@ -0,0 +1,6 @@
+---
+# Variables listed here are applicable to all host groups
+
+src_dnsdemux: ../../../../temp_config/dnsdemux
+dst_dnsdemux_conf: /etc/dnsdemux/default/
+
diff --git a/planetstack/rr_observer/playbook/roles/redir/handlers/main.yml b/planetstack/rr_observer/playbook/roles/redir/handlers/main.yml
new file mode 100644
index 0000000..8aa497e
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/redir/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart dnsredir
+ service: name=dnsredir state=restarted
diff --git a/planetstack/rr_observer/playbook/roles/redir/tasks/main.yml b/planetstack/rr_observer/playbook/roles/redir/tasks/main.yml
new file mode 100644
index 0000000..e390ed9
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/redir/tasks/main.yml
@@ -0,0 +1,19 @@
+---
+# This playbook contains plays to copy configurations to destination
+- name: create maps.d directory ( and creates all intermeadiate directories )
+ #copy: src={{src_dnsredir}}/{{name}}.d dest={{dst_dnsredir_confdir}}
+ file: src={{src_dnsredir}}/{{name}}.d/maps.d dest={{dst_dnsredir_confdir}}/{{name}}.d/maps.d state=directory
+
+- name: copy map.conf
+ copy: src={{src_dnsredir}}/{{name}}.d/maps.d/map.conf dest={{dst_dnsredir_confdir}}/{{name}}.d/maps.d/map.conf
+
+- name: copy codeen_nodes.conf
+ copy: src={{src_dnsredir}}/{{name}}.d/codeen_nodes.conf dest={{dst_dnsredir_confdir}}/{{name}}.d/codeen_nodes.conf
+
+- name: copy node-to-ip.txt
+ copy: src={{src_dnsredir}}/{{name}}.d/node-to-ip.txt dest={{dst_dnsredir_confdir}}/{{name}}.d/node-to-ip.txt
+
+- name: copy dnsredir config file
+ copy: src={{src_dnsredir}}/{{name}}.conf dest={{dst_dnsredir_conf}}/{{name}}.conf
+ notify: restart dnsredir
+
diff --git a/planetstack/rr_observer/playbook/roles/redir/vars/main.yml b/planetstack/rr_observer/playbook/roles/redir/vars/main.yml
new file mode 100644
index 0000000..dc79d35
--- /dev/null
+++ b/planetstack/rr_observer/playbook/roles/redir/vars/main.yml
@@ -0,0 +1,6 @@
+---
+# Variables listed here are applicable to all host groups
+
+src_dnsredir: ../../../../temp_config/dnsredir
+dst_dnsredir_conf: /etc/dnsredir/conf.d/
+dst_dnsredir_confdir: /etc/dnsredir
diff --git a/planetstack/rr_observer/playbook/site_demux.yml b/planetstack/rr_observer/playbook/site_demux.yml
new file mode 100644
index 0000000..b5261dc
--- /dev/null
+++ b/planetstack/rr_observer/playbook/site_demux.yml
@@ -0,0 +1,9 @@
+---
+# This playbook copies the dnsdemux configuration files from temp directory.
+
+- name: copies the configuration files from temp directory
+ hosts: all
+ #remote_user: {{r_user}}
+
+ roles:
+ - demux
diff --git a/planetstack/rr_observer/playbook/site_demux_delete.yml b/planetstack/rr_observer/playbook/site_demux_delete.yml
new file mode 100644
index 0000000..49a7c87
--- /dev/null
+++ b/planetstack/rr_observer/playbook/site_demux_delete.yml
@@ -0,0 +1,9 @@
+---
+# This playbook deletes the dnsdemux configuration files from request router instances
+
+- name: deletes the configuration files from request router instances
+ hosts: all
+ #remote_user: {{r_user}}
+
+ roles:
+ - delete_demux
diff --git a/planetstack/rr_observer/playbook/site_redir.yml b/planetstack/rr_observer/playbook/site_redir.yml
new file mode 100644
index 0000000..50a7284
--- /dev/null
+++ b/planetstack/rr_observer/playbook/site_redir.yml
@@ -0,0 +1,9 @@
+---
+# This playbook copies the dnsredir configuration files from temp directory.
+
+- name: copies the configuration files from temp directory
+ hosts: all
+ #remote_user: {{r_user}}
+
+ roles:
+ - redir
diff --git a/planetstack/rr_observer/playbook/site_redir_delete.yml b/planetstack/rr_observer/playbook/site_redir_delete.yml
new file mode 100644
index 0000000..9a8611d
--- /dev/null
+++ b/planetstack/rr_observer/playbook/site_redir_delete.yml
@@ -0,0 +1,9 @@
+---
+# This playbook deletes the dnsredir configuration files from request router instances
+
+- name: deletes the configuration files from request router instances
+ hosts: all
+ #remote_user: {{r_user}}
+
+ roles:
+ - delete_redir