Files
puppet-nova/manifests/migration/libvirt.pp
Clayton O'Neill 00e744a9b1 Add Puppet 4.x lint checks
This changes the puppet-lint requirement to 1.1.x, so that we can use
puppet-lint plugins.  Most of these plugins are for 4.x compat, but some
just catch common errors.

Change-Id: I48838fa11902247101c0473abff65cbb2558f609
2015-02-16 15:58:23 -05:00

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")
}
}
}