|
44 | 44 | from .nitro_resource_map import NITRO_RESOURCE_MAP |
45 | 45 |
|
46 | 46 |
|
| 47 | +skippable_resource_list = [ |
| 48 | + # In some cases, although keys are listed as immutable in the nitro_resource_map, they can actually be updated. |
| 49 | + # This list helps bypass the immutability check for these resources. |
| 50 | + "sytemfile" |
| 51 | +] |
| 52 | + |
| 53 | + |
47 | 54 | class ModuleExecutor(object): |
48 | 55 | def __init__(self, resource_name, supports_check_mode=True): |
49 | 56 | self.resource_name = resource_name |
@@ -365,6 +372,14 @@ def is_resource_identical(self): |
365 | 372 |
|
366 | 373 | return (False, None) if diff_list else (True, None) |
367 | 374 |
|
| 375 | + @trace |
| 376 | + def install(self): |
| 377 | + ok, err = create_resource( |
| 378 | + self.client, self.resource_name, self.resource_module_params |
| 379 | + ) |
| 380 | + if not ok: |
| 381 | + self.return_failure(err) |
| 382 | + |
368 | 383 | @trace |
369 | 384 | def create_or_update(self): |
370 | 385 | self.update_diff_list( |
@@ -453,7 +468,7 @@ def create_or_update(self): |
453 | 468 | self.client, self.resource_name, self.resource_module_params |
454 | 469 | ) |
455 | 470 |
|
456 | | - elif immutable_keys_list is None: |
| 471 | + elif immutable_keys_list is None or self.resource_name in skippable_resource_list: |
457 | 472 | self.module_result["changed"] = True |
458 | 473 | log( |
459 | 474 | "INFO: Resource %s:%s exists and is different. Will be UPDATED." |
@@ -957,6 +972,9 @@ def main(self): |
957 | 972 | if "bindings" in NITRO_RESOURCE_MAP[self.resource_name].keys(): |
958 | 973 | self.sync_all_bindings() |
959 | 974 |
|
| 975 | + elif self.resource_name == "install" and self.module.params["state"] == "installed": |
| 976 | + self.install() |
| 977 | + |
960 | 978 | elif self.module.params["state"] in { |
961 | 979 | "created", |
962 | 980 | "imported", |
|
0 commit comments