diff --git a/library/decort_rg.py b/library/decort_rg.py index 44d2f29..750c9a7 100644 --- a/library/decort_rg.py +++ b/library/decort_rg.py @@ -507,9 +507,16 @@ def main(): else: if amodule.params['state'] in ('present', 'enabled'): - decon.create() - if amodule.params['access']: - decon.access() + if not amodule.params['rg_name']: + decon.result['failed'] = True + decon.result['msg'] = ( + 'Resource group could not be created because' + ' the "rg_name" parameter was not specified.' + ) + else: + decon.create() + if amodule.params['access']: + decon.access() elif amodule.params['state'] in ('disabled'): decon.error()