Bug #2134
closed"rake puppet:import:puppet_classes" not detecting added class parameters properly
Description
After updating a parameterized class to have a new parameter, "rake puppet:import:puppet_classes" doe not detect the changed parameter.
Deleting the class completely and reimporting does import the class with all defined parameters.
Updated by Ohad Levy over 11 years ago
- Status changed from New to Feedback
can you provide an example? we use the exact same method to import so I'm not sure...
Updated by David Schmitt over 11 years ago
This is the class in question:
class sge ( $cluster = 'cluster', $type , $version = 'ogs2011.11', $snp, $ngs, $customer, $reserved_cores = 0, $python = '', $admin = 'puppet@example.com', $project = 'cluster' ) { include sge::execd, sge::package }
In the database was a version with only four of those parameters. Importing does not add the new ones.
Updated by David Schmitt over 11 years ago
Interestingly enough, updating from the webinterface actually did update the parameters.
Updated by Ohad Levy over 11 years ago
any chance you are not running in the same RAILS_ENV ?
Updated by David Schmitt over 11 years ago
Sadly, there is not much chance for that:
-bash-4.1$ RAILS_ENV=production rake puppet:import:puppet_classes Evaluating possible changes to your installation Scheduled changes to your environment Create/update environments Delete environments production : Remove environment Proceed with these modifications? <yes|no> no -bash-4.1$ cat config/database.yml # SQLite version 3.x # gem install sqlite3 development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: postgresql database: foreman pool: 5 timeout: 5000 -bash-4.1$ ls db/ migrate schema.rb -bash-4.1$
Again, I did changes to a class in the modules, which was detected by the foreman proxy, but not by the rake task.
Something fishy is happening though:
-bash-4.1$ RAILS_ENV=production strace -e file -f -s=100 rake puppet:import:puppet_classes[batch] 2>&1 | grep /srv/puppet [pid 28181] stat("/srv/puppet/environments/production/modules", 0x7fff0ef5dd80) = -1 ENOENT (No such file or directory) -bash-4.1$
All our modules are located in /src/puppet/environments/* and I'd have expected that strace to turn up more accesses to that location.
Updated by David Schmitt about 11 years ago
I've retested this on 1.1stable with the patch from #2067 and this problem did not manifest itself again.
From my side, this can be closed.
Updated by Dominic Cleal about 11 years ago
- Status changed from Feedback to Closed
Thanks for testing David!