From 8019326bc5710dfa763e065f979112c6176d4d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20K=C3=A4mmerling?= Date: Mon, 29 Jun 2020 07:47:49 +0200 Subject: [PATCH] Add hcloud_load_balancer_target.py --- plugins/modules/hcloud_load_balancer_target.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/modules/hcloud_load_balancer_target.py b/plugins/modules/hcloud_load_balancer_target.py index 8d5514b..7fa0885 100644 --- a/plugins/modules/hcloud_load_balancer_target.py +++ b/plugins/modules/hcloud_load_balancer_target.py @@ -148,7 +148,10 @@ class AnsibleHcloudLoadBalancerTarget(Hcloud): "target": None } - if params["type"] == "server": + if self.module.params.get("type") == "server": + self.module.fail_on_missing_params( + required_params=["server"] + ) params["target"] = LoadBalancerTarget(type=self.module.params.get("type"), server=self.hcloud_server, use_private_ip=self.module.params.get("use_private_ip")) if not self.module.check_mode: