Nosmoht / ansible-module-foreman

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

How to update an existing host instead of try to create? #62

Closed agomerz closed 6 years ago

agomerz commented 7 years ago

I would like to be able to use this to create hostgroups and simply add instances to them. The instances would already exist.

fatal: [ag-testanslb-1]: FAILED! => {"changed": false, "failed": true, "msg": "Could not create host: Name has already been taken"}
Nosmoht commented 7 years ago

Hi, did you try with FQDN or just hostname?

please post you action so I can try to reproduce it.

mark-wagner commented 6 years ago

Looking through the source code, foreman_host.py only supports updating host parameters, not other properties of hosts. In fact, the underlying module foreman.py does not define an update_host() function.