hcloud_server fails with a runtime error when specifying an already absent server to be removed.
- name: remove hosts
hcloud_server:
name:
- already.absent.host
state: absent
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "panic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x122e20b]\n\ngoroutine 1 [running]:\ngithub.com/thetechnick/hcloud-ansible/vendor/github.com/hetznercloud/hcloud-go/hcloud.(*ServerClient).Delete(0xc4200f2068, 0x14280e0, 0xc420010098, 0x0, 0x1, 0x1, 0x0)\n\t/home/nschieder/Projects/go/src/github.com/thetechnick/hcloud-ansible/vendor/github.com/hetznercloud/hcloud-go/hcloud/server.go:284 +0x3b\nmain.(*module).absent(0xc42000e9c0, 0x14280e0, 0xc420010098, 0x0, 0x0, 0xc420010000, 0x0, 0xc420044bc0, 0x1)\n\t/home/nschieder/Projects/go/src/github.com/thetechnick/hcloud-ansible/cmd/hcloud_server/main.go:118 +0x102\nmain.(*module).run(0xc42000e9c0, 0x14280e0, 0xc420010098, 0x0, 0x0, 0xc42003be80, 0x1010be8, 0x20, 0x12afd00)\n\t/home/nschieder/Projects/go/src/github.com/thetechnick/hcloud-ansible/cmd/hcloud_server/main.go:97 +0x2fb\nmain.(*module).Run(0xc42000e9c0, 0xc4200d8520, 0x3c5, 0x1262220, 0xc42000e9c0, 0x0, 0x0)\n\t/home/nschieder/Projects/go/src/github.com/thetechnick/hcloud-ansible/cmd/hcloud_server/main.go:84 +0xd3\ngithub.com/thetechnick/hcloud-ansible/pkg/ansible.RunModule(0x1425fe0, 0xc42000e9c0, 0xc4200860f0)\n\t/home/nschieder/Projects/go/src/github.com/thetechnick/hcloud-ansible/pkg/ansible/module.go:51 +0x3e0\nmain.main()\n\t/home/nschieder/Projects/go/src/github.com/thetechnick/hcloud-ansible/cmd/hcloud_server/main.go:565 +0x76\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 2}
Module should return an "ok" status, since server is already absent.