Open aleks-mariusz opened 7 years ago
Hi @aleks-mariusz,
You need to provide some logic in your profile to make it works:
cobbler httpd config file goes with rpm package and httpd is installed as dependency so the httpd isn't listed as requirements for that module. That module won't manage httpd service/files for you.. you need another module for that.
thanks.. i'm trying to figure out the best way to get this handled..
so i do have another module that manages httpd and should start it.. i included it, so i got a little further before running into this message again.. but i haven't gotten to the point where the cobblerd/httpd service starts yet (shouldn't the class start cobblerd at least?)
does the module, before the catalog is applied, try to run the collection stuff on existing providers to see what's there?
So i looked at this some more and I have to ask, is this module only designed to be able to manage already installed cobbler systems perhaps, and not really tested/written to be ran/stood up on a freshly installed system to stand up cobbler? I am not sure if i just missed that in the documentation or if that's not clearly mentioned..
Otherwise it seems like a bug that the createresources, before it gets to the point where it's looking at dependencies, is trying to collect the existing cobbler* resources. A catch 22 for a newly set up system before cobbler has been set up.
How would I bootstrap a new cobbler setup, puppet crashes when the cobbler_* providers make the call trying to collect existing resources:
Debug: Prefetching ruby resources for cobbler_distro
Debug: Storing state
Debug: Stored state in 0.11 seconds
Error: Failed to apply catalog: Connection refused - connect(2) for "127.0.0.1" port 80
We can't create those resources UNTIL httpd is set. As a work-around I would have to split up my parent module (that uses your cobbler module), into a separate the initial setup of cobbler into a separate sub-class and leave the management part of the resources in the main class. But this would cause me to have to run puppet in two phases, one where it sets up cobbler and another later that actually does the management (since using a 'require' keyword on your class makes it pre-check whether there's any existing resources).
Perhaps the cobbler_* providers should catch connection refused and treat that as 0 resources?
I have a httpd profile that sets up vhost config file for cobbler. I have another profile where I use createresource('cobbler*', ....) functions. In my main module I set the following order:
Class['::cobbler'] ->
Class['::profile::cobbler::apahce'] ->
Class['::profile::cobbler::objects']
I do cobbler first to make sure that cobbler is installed and configured properly. I hope this will help to build a proper order in your module
I tried that, but the provider instances code is getting run when calculating the dependencies, and since it causes puppet to crash, it never gets to the httpd/cobblerd part
I'm writing a module that leverages yours and i've gotten it to start running but it dies at the end with:
It's unclear whether httpd is actually a prerequisite not mentioned for this module to be used?
I was under the (perhaps naive) assumption that this module would set up an httpd service as part of its run, to have an entire working cobbler environment (since one usually includes httpd as part of the installation normal).
Could you please clarify ?