Skip to content

Commit

Permalink
Use requires_ansible from manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolenz committed Jan 8, 2024
1 parent c08274e commit 6d22fd0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ collection:
path: /collections/ansible_collections/vmware/vmware_rest
namespace: vmware
name: vmware_rest
requires_ansible: 2.14.0
plugins:
- type: module_openapi
name: "vmware_rest"
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/generate_cloud_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ def generate_vmware_rest(args: Iterable, role_path: str):
meta_dir.mkdir(parents=True, exist_ok=True)

yaml_dict = {
"requires_ansible": """>=2.14.0""",
"requires_ansible": (">=%s") % args.get("requires_ansible"),
"action_groups": {"vmware_rest": []},
}

Expand Down
1 change: 1 addition & 0 deletions roles/module_openapi_cloud/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
schema_dir: "{{ plugin['api_object_path'] }}"
modules: "{{ plugin['resource'] }}"
next_version: "{{ plugin['module_version'] }}"
requires_ansible: "{{ collection['requires_ansible'] }}"
changed_when: false
when: ( plugin['action'] == 'generate_modules' ) or ( plugin['action'] == 'generate_all' )

Expand Down
12 changes: 11 additions & 1 deletion roles/run/files/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@
"path",
"namespace",
"name"
]
],
"if": {
"properties": {
"name": {
"const": "vmware_rest"
}
}
},
"then": {
"required": ["requires_ansible"]
}
},
"license_file": {
"type": "string"
Expand Down

0 comments on commit 6d22fd0

Please sign in to comment.