我们的OpenStack安装与Puppet一起推出。 我们使用优秀的puppetlabs-openstack模块。 由于周转缓慢,我们仍然坚持版本5.0.2 ,现在我们不能迁移到一个较新的版本。 所以这个问题与OpenStack 2014.2.2有关。
我们当前的networking设置(GRE-tunneled)迫使我们通过DHCP向计算节点上的访客虚拟机宣布1454的MTU。 我们很清楚,我们可以通过在/etc/neutron/dnsmasq-neutron.conf提供相关的configuration并在/etc/neutron/dnsmasq-neutron.conf指定。 现在的问题是,我们缺乏适当的木偶知识configuration这些参数“木偶路”。
当前的configuration如下所示:
(1)我们使用文件资源在我们单个networking节点上的相应位置创builddnsmasq-neutron.conf文件。 这显然工作得很好,我相信我们可以保持这种方式。
file { 'dnsmasq-neutron.conf': name => '/etc/neutron/dnsmasq-neutron.conf', mode => '0644', owner => 'root', group => 'neutron', content => template('/etc/puppet/manifests/neutron/dnsmasq-neutron.erb') }
(2)目前我们使用下面这个非常糟糕的方式将configuration行注入到dhcp_agent.ini文件中。
exec { 'dnsmasq_config-file': command => '/usr/bin/echo "dnsmasq_config_file=/etc/neutron/dnsmasq-neutron.conf" >> /etc/neutron/dhcp_agent.ini && /usr/sbin/service neutron-dhcp-agent restart', user => 'root', }
我们的第一个猜测是使用没有按预期工作的Augeas。 而且我们知道必须有一种方法来设置干净的Puppetpipe理方式的dnsmasq_config_file属性。 实际上有一个class neutron::agents::dhcp的参数叫做dnsmasq_config_file ,默认是undefined。
问题是: 如何正确设置此参数? 我们目前的networking节点configuration可以在下面find。
node 'network.lan' inherits basenode { class { '::openstack::role::network' : #dnsmasq_config_file => '/etc/neutron/dnsmasq-neutron.conf' } file { 'dnsmasq-neutron.conf': name => '/etc/neutron/dnsmasq-neutron.conf', mode => '0644', owner => 'root', group => 'neutron', content => template('/etc/puppet/manifests/neutron/dnsmasq-neutron.erb') } exec { 'dnsmasq_config-file': command => '/usr/bin/echo "dnsmasq_config_file=/etc/neutron/dnsmasq-neutron.conf" >> /etc/neutron/dhcp_agent.ini && /usr/sbin/service neutron-dhcp-agent restart', user => 'root', } }
上面提供的解决scheme工作。 但是,DHCP代理/ dnsmasq会在每次运行Puppet时重新启动两次。 一些额外的资源,如我们的防火墙设置,从上面的代码中被剥离,因为他们只会混淆这个例子。