adfinis / foreman-yml

Make automated Foreman configuration as easy as pie.
GNU General Public License v3.0
27 stars 25 forks source link

Host creation failure #35

Closed Mandorath closed 2 years ago

Mandorath commented 7 years ago

Hey,

I'm adding some extra functionalities including the option to specify location and organizations. Basically the script will ask if organization and/or locations are used and than enable these options. I'm running into a small problem when creating hosts though i've traced it to the following part of code and I'm wondering what it specifically does:

 try:
                    fixif = {
                        'id':           fmh['interfaces'][0]['id'],
                        'managed':      'false',
                        'primary':      'true',
                        'provision':    'true'
                    }
                    fixhost = {
                        'interfaces_attributes':        [ fixif ],
                        'host_parameters_attributes':   host_params
                    }
                    try:
                        self.fm.hosts.update(fixhost, fmh['id'])
                        return fmh
                    except:
                        log.log(log.LOG_DEBUG, "An Error Occured when linking Host '{0}' (non-fatal)".format(hostc['name']))
                except:
pass

I've removed it in my test setup and I can't detect any changes, I'm assuming this was added to fix some kind of error that occured but I don't have any errors when I run foreman-yaml without it.

Mandorath commented 7 years ago

I've already found a fix for this. I've also found a way to add multiple interfaces based on a loop.

karras commented 2 years ago

Project archived