Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvm: do not configure libvirtd to listen on TCP port 16509 #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Ansible/roles/kvm/tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp={{ item.regexp }} line={{ item.line }} state=present
with_items:
- { regexp: "listen_tls", line: "listen_tls = 0" }
- { regexp: "listen_tcp", line: "listen_tcp = 1" }
- { regexp: "listen_tcp", line: "listen_tcp = 0" }
- { regexp: "tls_port", line: "tcp_port = \"16514\"" }
- { regexp: "tcp_port", line: "tcp_port = \"16509\"" }
- { regexp: "auth_tcp", line: "auth_tcp = \"none\"" }
- { regexp: "mdns_adv", line: "mdns_adv = 0" }
Expand Down Expand Up @@ -151,7 +152,7 @@
with_items:
- "22"
- "1798"
- "16509"
- "16514"
- "5900:6100"
- "49152:49216"
when: ansible_distribution_major_version == "6" or not use_firewalld
Expand All @@ -164,7 +165,7 @@
with_items:
- "22"
- "1798"
- "16509"
- "16514"
- "5900-6100"
- "49152-49216"
when: ( ansible_distribution_major_version == "7" ) and use_firewalld
Expand Down Expand Up @@ -206,4 +207,4 @@
- include: ./centos_elrepokernel.yml
when: kvm_install_elrepo_kernel
tags:
- kvm
- kvm
7 changes: 4 additions & 3 deletions Ansible/roles/kvm/tasks/centos8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp={{ item.regexp }} line={{ item.line }} state=present
with_items:
- { regexp: "listen_tls", line: "listen_tls = 0" }
- { regexp: "listen_tcp", line: "listen_tcp = 1" }
- { regexp: "listen_tcp", line: "listen_tcp = 0" }
- { regexp: "tls_port", line: "tcp_port = \"16514\"" }
- { regexp: "tcp_port", line: "tcp_port = \"16509\"" }
- { regexp: "auth_tcp", line: "auth_tcp = \"none\"" }
- { regexp: "mdns_adv", line: "mdns_adv = 0" }
Expand Down Expand Up @@ -162,7 +163,7 @@
with_items:
- "22"
- "1798"
- "16509"
- "16514"
- "5900:6100"
- "49152:49216"
when: ansible_distribution_major_version == "6" or not use_firewalld
Expand All @@ -175,7 +176,7 @@
with_items:
- "22"
- "1798"
- "16509"
- "16514"
- "5900-6100"
- "49152-49216"
when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld
Expand Down
7 changes: 4 additions & 3 deletions Ansible/roles/kvm/tasks/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp={{ item.regexp }} line={{ item.line }} state=present
with_items:
- { regexp: "listen_tls", line: "listen_tls = 0" }
- { regexp: "listen_tcp", line: "listen_tcp = 1" }
- { regexp: "listen_tcp", line: "listen_tcp = 0" }
- { regexp: "tls_port", line: "tcp_port = \"16514\"" }
- { regexp: "tcp_port", line: "tcp_port = \"16509\"" }
- { regexp: "auth_tcp", line: "auth_tcp = \"none\"" }
- { regexp: "mdns_adv", line: "mdns_adv = 0" }
Expand Down Expand Up @@ -144,7 +145,7 @@
with_items:
- "22"
- "1798"
- "16509"
- "16514"
- "5900:6100"
- "49152:49216"
when: not use_firewalld
Expand All @@ -157,7 +158,7 @@
with_items:
- "22"
- "1798"
- "16509"
- "16514"
- "5900-6100"
- "49152-49216"
when: use_firewalld
Expand Down
7 changes: 5 additions & 2 deletions Ansible/roles/kvm/tasks/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
with_items:
- "22"
- "1798"
- "16509"
- "16514"
- "5900:6100"
- "49152:49216"

Expand Down Expand Up @@ -298,7 +298,10 @@
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp="#listen_tls = 0" line="listen_tls = 0"

- name: Updated /etc/libvirt/libvirtd.conf
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp='#listen_tcp = 1' line='listen_tcp = 1'
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp='#listen_tcp = 1' line='listen_tcp = 0'

- name: Updated /etc/libvirt/libvirtd.conf
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp='#tls_port= "16514"' line='tls_port = "16514"'

- name: Updated /etc/libvirt/libvirtd.conf
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp='#tcp_port= "16509"' line='tcp_port = "16509"'
Expand Down