
In the last commit, I introduced a dependency cyle: (File_line[/etc/sysconfig/libvirtd libvirtd args] => Service[libvirt] => Class[Nova::Compute::Libvirt] => File_line[/etc/sysconfig/libvirtd libvirtd args]) The "require" is useless, since the migration class is called by nova::compute::libvirt, let's delete it. Change-Id: I97aeb9dcc11bb867e020826ad9ed5d7d0e04a8e8
78 lines
2.4 KiB
Puppet
78 lines
2.4 KiB
Puppet
# == Class: nova::migration::libvirt
|
|
#
|
|
# Sets libvirt config that is required for migration
|
|
#
|
|
class nova::migration::libvirt {
|
|
|
|
Package['libvirt'] -> File_line<| path == '/etc/libvirt/libvirtd.conf' |>
|
|
|
|
case $::osfamily {
|
|
'RedHat': {
|
|
file_line { '/etc/libvirt/libvirtd.conf listen_tls':
|
|
path => '/etc/libvirt/libvirtd.conf',
|
|
line => 'listen_tls = 0',
|
|
match => 'listen_tls =',
|
|
notify => Service['libvirt'],
|
|
}
|
|
|
|
file_line { '/etc/libvirt/libvirtd.conf listen_tcp':
|
|
path => '/etc/libvirt/libvirtd.conf',
|
|
line => 'listen_tcp = 1',
|
|
match => 'listen_tcp =',
|
|
notify => Service['libvirt'],
|
|
}
|
|
|
|
file_line { '/etc/libvirt/libvirtd.conf auth_tcp':
|
|
path => '/etc/libvirt/libvirtd.conf',
|
|
line => 'auth_tcp = "none"',
|
|
match => 'auth_tcp =',
|
|
notify => Service['libvirt'],
|
|
}
|
|
|
|
file_line { '/etc/sysconfig/libvirtd libvirtd args':
|
|
path => '/etc/sysconfig/libvirtd',
|
|
line => 'LIBVIRTD_ARGS="--listen"',
|
|
match => 'LIBVIRTD_ARGS=',
|
|
notify => Service['libvirt'],
|
|
}
|
|
|
|
Package['libvirt'] -> File_line<| path == '/etc/sysconfig/libvirtd' |>
|
|
}
|
|
|
|
'Debian': {
|
|
file_line { '/etc/libvirt/libvirtd.conf listen_tls':
|
|
path => '/etc/libvirt/libvirtd.conf',
|
|
line => 'listen_tls = 0',
|
|
match => 'listen_tls =',
|
|
notify => Service['libvirt'],
|
|
}
|
|
|
|
file_line { '/etc/libvirt/libvirtd.conf listen_tcp':
|
|
path => '/etc/libvirt/libvirtd.conf',
|
|
line => 'listen_tcp = 1',
|
|
match => 'listen_tcp =',
|
|
notify => Service['libvirt'],
|
|
}
|
|
|
|
file_line { '/etc/libvirt/libvirtd.conf auth_tcp':
|
|
path => '/etc/libvirt/libvirtd.conf',
|
|
line => 'auth_tcp = "none"',
|
|
match => 'auth_tcp =',
|
|
notify => Service['libvirt'],
|
|
}
|
|
file_line { "/etc/default/${::nova::compute::libvirt::libvirt_service_name} libvirtd opts":
|
|
path => "/etc/default/${::nova::compute::libvirt::libvirt_service_name}",
|
|
line => 'libvirtd_opts="-d -l"',
|
|
match => 'libvirtd_opts=',
|
|
notify => Service['libvirt'],
|
|
}
|
|
|
|
Package['libvirt'] -> File_line<| path == "/etc/default/${::nova::compute::libvirt::libvirt_service_name}" |>
|
|
}
|
|
|
|
default: {
|
|
warning("Unsupported osfamily: ${::osfamily}, make sure you are configuring this yourself")
|
|
}
|
|
}
|
|
}
|