Issue #2964 has been updated by Dan Bode.
I grabbed origin/0.25.x for this just to clarify.
a few point not mentioned before
1. exporter is the same node as the server
2. first, I clean out the db using ruby puppetstoredconfigclean.rb exporter
collector
3. related config
<pre>
[puppetmasterd]
storeconfigs = true
dbadapter = mysql
dbuser = puppet
dbpassword = password
dbserver = localhost
dbsocket = /var/lib/mysql/mysql.sock
</pre>
#site.pp
<pre>
node exporter {
@@host { 'test':
ip => "127.0.0.2",
alias => 'test-alias',
}
Host<<||>>
}
</pre>
#first run
<pre>
[r...@exporter manifests]# !pu
puppetd --certname exporter --test
warning: SELinux not installed
info: Connecting to mysql database: puppet
info: Caching facts for exporter
info: Caching catalog for exporter
info: Applying configuration version '1261339485'
notice: //Node[exporter]/Host[test]/ensure: created
info: Filebucket[/var/lib/client//clientbucket]: Adding
/etc/hosts(3844956ab64e6edcf0a89ab84b4f1f4d)
notice: Finished catalog run in 0.05 seconds
</pre>
<pre>
mysql> select * from param_values;
+-----+------------+---------------+------+-------------+---------------------+---------------------+
| id | value | param_name_id | line | resource_id | updated_at |
created_at |
+-----+------------+---------------+------+-------------+---------------------+---------------------+
| 166 | test-alias | 3 | NULL | 129 | 2009-12-20 12:04:45 |
2009-12-20 12:04:45 |
| 167 | 127.0.0.2 | 1 | NULL | 129 | 2009-12-20 12:04:45 |
2009-12-20 12:04:45 |
+-----+------------+---------------+------+-------------+---------------------+---------------------+
2 rows in set (0.00 sec)
</pre>
# now change ip and run again
<pre>
node exporter {
@@host { 'test':
ip => "127.0.0.3",
alias => 'test-alias',
}
Host<<||>>
}
</pre>
<pre>
[r...@exporter manifests]# !pu
puppetd --certname exporter --test
warning: SELinux not installed
info: Connecting to mysql database: puppet
info: Caching catalog for exporter
info: Applying configuration version '1261339742'
notice: //Node[exporter]/Host[test]/ip: ip changed '127.0.0.2' to '127.0.0.3'
info: Filebucket[/var/lib/client//clientbucket]: Adding
/etc/hosts(b25ac177b4286e8f747a38f9a450d5a8)
notice: Finished catalog run in 0.05 seconds
</pre>
<pre>
mysql> select * from param_values;
+-----+------------+---------------+------+-------------+---------------------+---------------------+
| id | value | param_name_id | line | resource_id | updated_at |
created_at |
+-----+------------+---------------+------+-------------+---------------------+---------------------+
| 166 | test-alias | 3 | NULL | 129 | 2009-12-20 12:04:45 |
2009-12-20 12:04:45 |
+-----+------------+---------------+------+-------------+---------------------+---------------------+
1 row in set (0.00 sec)
</pre>
<pre>
[r...@exporter manifests]# puppetd --certname exporter --test
warning: SELinux not installed
info: Connecting to mysql database: puppet
info: Caching catalog for exporter
info: Applying configuration version '1261339742'
notice: Finished catalog run in 0.02 seconds
</pre>
<pre>
mysql> select * from param_values;
+-----+------------+---------------+------+-------------+---------------------+---------------------+
| id | value | param_name_id | line | resource_id | updated_at |
created_at |
+-----+------------+---------------+------+-------------+---------------------+---------------------+
| 166 | test-alias | 3 | NULL | 129 | 2009-12-20 12:04:45 |
2009-12-20 12:04:45 |
| 168 | 127.0.0.3 | 1 | 6 | 129 | 2009-12-20 12:10:29 |
2009-12-20 12:10:29 |
+-----+------------+---------------+------+-------------+---------------------+---------------------+
2 rows in set (0.00 sec)
</pre>
----------------------------------------
Bug #2964: updated resources cannot be collected until they are exported twice
http://projects.reductivelabs.com/issues/2964
Author: Dan Bode
Status: Needs more information
Priority: Normal
Assigned to: Dan Bode
Category:
Target version: 0.25.2
Affected version: 0.25.1
Keywords:
Branch:
I noticed the following behavior. When an exported resource already exists in
the database, and I want to update a param, puppet has to run twice to update
the param.
1. The first run removes the param_values row
2. The second run updates teh param_values row.
Is this the expected bahavior?
Below is a detailed example:
#Here is the basic file
site.pp
<pre>
node exporter {
@@host { 'test':
ip => "127.0.0.1",
}
}
node collector {
Host<<| |>>
}
</pre>
#export for the first time
[r...@exporter manifests]# puppetd --certname exporter --test
and here is the db
<pre>
mysql> select * from param_values;
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| id | value | param_name_id | line | resource_id | updated_at |
created_at |
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| 45 | 127.0.0.1 | 1 | NULL | 52 | 2009-12-18 17:30:14 |
2009-12-18 17:30:14 |
+----+-----------+---------------+------+-------------+---------------------+---------------------+
1 row in set (0.00 sec)
mysql> select * from resources where title='test';
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| id | title | restype | host_id | source_file_id | exported | line |
updated_at | created_at |
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| 52 | test | Host | 14 | 2 | 1 | 4 |
2009-12-18 17:30:14 | 2009-12-18 17:30:14 |
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
</pre>
now change the ip address to 127.0.0.2
# this removed the param values from the db????
[r...@exporter manifests]# puppetd --certname exporter --test
<pre>
mysql> select * from param_values;
Empty set (0.00 sec)
mysql> select * from resources where title='test';
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| id | title | restype | host_id | source_file_id | exported | line |
updated_at | created_at |
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| 52 | test | Host | 14 | 2 | 1 | 4 |
2009-12-18 17:30:14 | 2009-12-18 17:30:14 |
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
1 row in set (0.00 sec)
</pre>
of coarse, we cant properly collect now
[r...@collector manifests]# puppetd --certname collector --test
info: Caching catalog for collector
info: Applying configuration version '1261186363'
notice: Finished catalog run in 0.09 seconds
#now if I run it a second time, the ip is updated in the db
[r...@exporter manifests]# puppetd --certname exporter --test
<pre>
mysql> select * from param_values;
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| id | value | param_name_id | line | resource_id | updated_at |
created_at |
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| 46 | 127.0.0.2 | 1 | 4 | 52 | 2009-12-18 17:35:30 |
2009-12-18 17:35:30 |
+----+-----------+---------------+------+-------------+---------------------+---------------------+
1 row in set (0.00 sec)
</pre>
#now collection works
[r...@collector manifests]# puppetd --certname collector --test
info: Caching catalog for collector
info: Applying configuration version '1261186363'
notice: //Node[collector]/Host[test]/ip: ip changed '127.0.0.1' to '127.0.0.2'
info: Filebucket[/var/lib/puppet/clientbucket]: Adding
/etc/hosts(2fff89c170a0f6eed1af1d711d189720)
notice: Finished catalog run in 0.10 seconds
is it supposed to work like this?
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.