Disable XOS grabbing port 80 via iptables
Remove /etc/libvirt/hooks/qemu
Change-Id: I840fa8611babcd9e2a438d1fca139e8a89a88a03
(cherry picked from commit 6d56bc6106b19331fedafbc36471674bb94a6005)
diff --git a/roles/config-virt/files/qemu b/roles/config-virt/files/qemu
deleted file mode 100644
index 451cdda..0000000
--- a/roles/config-virt/files/qemu
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-SHELL="/bin/bash"
-
-NIC=$( route|grep default|awk '{print $NF}' )
-
-NAME="${1}"
-OP="${2}"
-SUBOP="${3}"
-ARGS="${4}"
-
-add_rule() {
- TABLE=$1
- CHAIN=$2
- ARGS=$3
- iptables -t $TABLE -C $CHAIN $ARGS
- if [ "$?" -ne 0 ]
- then
- iptables -t $TABLE -I $CHAIN 1 $ARGS
- fi
-}
-
-add_port_fwd_rule() {
- DPORT=$1
- VMIP=$2
- TOPORT=$3
-
- add_rule "nat" "PREROUTING" "-p tcp -i $NIC --dport $DPORT -j DNAT --to-destination $VMIP:$TOPORT"
-}
-
-if [ "$OP" = "start" ]
-then
- XOS=$( getent hosts xos | awk '{print $1}' )
- if [ -n "$XOS" ]
- then
- add_port_fwd_rule 80 $XOS 80
- fi
- add_rule "filter" "FORWARD" "-p tcp --dport 80 -j ACCEPT"
-fi
-
diff --git a/roles/config-virt/handlers/main.yml b/roles/config-virt/handlers/main.yml
index 325f21d..82957e2 100644
--- a/roles/config-virt/handlers/main.yml
+++ b/roles/config-virt/handlers/main.yml
@@ -5,7 +5,3 @@
service:
name=libvirt-bin
state=restarted
-
-- name: run qemu hook
- command: /etc/libvirt/hooks/qemu start start
-
diff --git a/roles/config-virt/tasks/main.yml b/roles/config-virt/tasks/main.yml
index 66bf5d7..89c0c7d 100644
--- a/roles/config-virt/tasks/main.yml
+++ b/roles/config-virt/tasks/main.yml
@@ -49,17 +49,6 @@
autostart=yes
with_items: '{{ virt_nets }}'
-- name: Have libvirt enable port forwarding to VM's
- become: yes
- copy:
- src={{ item }}
- dest=/etc/libvirt/hooks/{{ item }}
- mode=0755 owner=root
- with_items:
- - qemu
- notify:
- - run qemu hook
-
- name: Wait for uvt-kvm image to be available
async_status: jid={{ uvt_sync.ansible_job_id }}
register: uvt_sync_result