diff --git a/library/kpm.py b/library/kpm.py index 69e42d612..aa44d4cc8 100644 --- a/library/kpm.py +++ b/library/kpm.py @@ -37,6 +37,11 @@ options: default: 'None' description: - The package version + variables: + required: false + default: 'None' + description: + - Set package variables state: required: false choices: ['present', 'absent'] @@ -78,11 +83,13 @@ def main(): state = dict(default='present', choices=['present', 'absent']), name = dict(required=True), force = dict(required=False, default=False, type='bool'), + variables = dict(required=False, default=None, type='dict'), registry = dict(required=False, default="https://api.kpm.sh"), namespace=dict(default='default', required=False))) params = {"version": module.params.get("version"), "namespace": module.params.get('namespace'), + "variables": module.params.get('variables'), "endpoint": module.params.get('registry'), "dry": module.check_mode, "proxy": None, diff --git a/roles/kubernetes-apps/tasks/main.yaml b/roles/kubernetes-apps/tasks/main.yaml index 36b010bf9..c74761dfc 100644 --- a/roles/kubernetes-apps/tasks/main.yaml +++ b/roles/kubernetes-apps/tasks/main.yaml @@ -4,6 +4,7 @@ registry: "{{item.registry | default(kpm_registry | default('https://api.kpm.sh'))}}" state: "{{item.state | default(omit)}}" version: "{{item.version | default(omit)}}" + variables: "{{item.variables | default(omit)}}" name: "{{item.name}}" with_items: "{{kpm_packages}}" register: kpmresults