[pve-devel] Problems with search Funktion in same recipe during first run

Christian Fröstl christian.froestl at nubon.com
Tue Aug 12 13:22:18 CEST 2014


Hi,

I have a partial search in my tomcat recipe. I use it for finding out the
MySQL Server Backend for the tomcat application server.
At the beginning of my tomcat recipe I get the information for the Mysql
Server:

 mysql_master_node = partial_search(:node, "roles:mysql_payment_server AND
chef_environment:#{node.chef_environment}",
                                           :keys => { 'name' => ['name'],
                                                      'ip' =>
['ipaddress'],
                                                      'kernel_version' =>
['kernel','version']
                                           }
        )
if mysql_master_node.length == 1
          mysql_master_node.each do |result|
            if result['name'] == node['machinename']
              node.set['tc']['payserver']['database_master'] = 'localhost'
            else
              node.set['tc']['payserver']['database_master'] =
mysql_master_node[0]['ip']
            end
          End

During the rest of the recipe, I will use the node variable
node['tc']['payserver'][‚database_master‘] to define the mysql backend
server in the server.xml of the tomcat.

template node['tc']['server_conf_file'] do
  source 'server.xml.erb'
  mode '0644'
  owner 'tomcatusr1'
  group 'tomcatusr1'
  variables({
                :mysql_master    =>
node['tc']['payserver']['database_master'],
            })
  notifies :restart, "service[#{node['tc']['service_name']}]"
End


It seems that the variable will set during the first run, and can only
used in the second chef-client run.
In the first run, the server.xml don’t have the content of
node['tc']['payserver'][‚database_master‘] in it. After the second run,
the file is correct.

Do you have any idea to solve this or is there a better way getting
backend server information?

Thanks in advance,
Christian



During the rest of the recipe,

Am 12.08.14 12:43 schrieb "Alexandre DERUMIER" unter <aderumier at odiso.com>:

>>>Would you mind to post that bug on the qemu-devel mailing list? Maybe
>>>there is another solution.
>Ok, I'll send a mail to qemu-devel mailing
>
>>>We also use virtio-serial for qga, so guest agent is also broken with
>>>q35? 
>
>Yes, I think it's the same.
>
>
>----- Mail original -----
>
>De: "Dietmar Maurer" <dietmar at proxmox.com>
>À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com
>Envoyé: Mardi 12 Août 2014 10:50:36
>Objet: RE: [pve-devel] [PATCH] q35 : spice virtio-serial on pcie.0
>
>> spice virtio-serial don't work on pci.0 with q35 (maybe it's not
>>working on pci 
>> bridge) 
>
>Would you mind to post that bug on the qemu-devel mailing list? Maybe
>there is another solution.
>
>We also use virtio-serial for qga, so guest agent is also broken with
>q35? 
>_______________________________________________
>pve-devel mailing list
>pve-devel at pve.proxmox.com
>http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



More information about the pve-devel mailing list