@@ -12,12 +12,30 @@ class ActionModule(ActionBase):
1212 def run (self , tmp = None , task_vars = None ):
1313 del tmp # tmp no longer has any effect
1414 new_module_args = copy .deepcopy (self ._task .args )
15- new_module_args ["nextcloud_path" ] = self ._task .args .get (
16- "nextcloud_path" , os .getenv ("NEXTCLOUD_PATH" )
15+
16+ # missing occ common arguments fallback
17+ # argument value precedence: args > task_vars > environment
18+ nextcloud_path = (
19+ self ._task .args .get ("nextcloud_path" )
20+ or task_vars .get ("nextcloud_path" )
21+ or os .getenv ("NEXTCLOUD_PATH" )
1722 )
18- if not new_module_args ["nextcloud_path" ]:
23+ if nextcloud_path :
24+ new_module_args ["nextcloud_path" ] = nextcloud_path
25+ elif "nextcloud_path" in new_module_args :
1926 del new_module_args ["nextcloud_path" ]
2027
28+ # argument value precedence: args > task_vars > environment > default
29+ php_runtime = (
30+ self ._task .args .get ("php_runtime" )
31+ or task_vars .get ("nextcloud_php_runtime" )
32+ or os .getenv ("NEXTCLOUD_PHP_RUNTIME" )
33+ )
34+ if php_runtime :
35+ new_module_args ["php_runtime" ] = php_runtime
36+ elif "php_runtime" in new_module_args :
37+ del new_module_args ["php_runtime" ]
38+
2139 return self ._execute_module (
2240 module_name = self ._task .action ,
2341 module_args = new_module_args ,
0 commit comments