Nosmoht / ansible-module-foreman

Ansible module to manage configuration of Foreman
49 stars 32 forks source link

foreman_hostgroup - global name 'xyx' not defined #46

Closed stokkie90 closed 7 years ago

stokkie90 commented 7 years ago

The Constants like ARCHITECTURE etc.. can't be found, because these constants are not imported from the Foreman module.

architecture_name = module.params[ARCHITECTURE]
compute_profile_name = module.params[COMPUTE_PROFILE]
domain_name = module.params[DOMAIN]
environment_name = module.params[ENVIRONMENT]
medium_name = module.params[MEDIUM]
operatingsystem_name = module.params[OPERATINGSYSTEM]
partition_table_name = module.params['partition_table']
realm_name = module.params['realm']
root_pass = module.params['root_pass']
smart_proxy_name = module.params[SMART_PROXY]
subnet_name = module.params[SUBNET]

Fix that's working:

from foreman.foreman import *
Nosmoht commented 7 years ago

Hi @stokkie90 ,

thanks for reporting. Seems that my change https://github.com/Nosmoht/ansible-module-foreman/commit/30ac0f6f559b1f98d16862078e037f64bf213f6b was wrong. I'll revert it.

Nosmoht commented 7 years ago

Should be fixed via https://github.com/Nosmoht/ansible-module-foreman/commit/da7779abdb0581f8e14865282bf7fb5266b99f56.

Can you confirm?