Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update k8s module arguments to allow resource_definition to be a string #40730

Merged
merged 1 commit into from Jun 29, 2018

Conversation

fabianvf
Copy link
Contributor

SUMMARY

Allows resource_definition to be a string, if it is, attempts to yaml load it (as it would do with src). This allows the user to template multi-document yaml files and defer the loading to k8s, preventing the normal error that from_yaml would give you with multidocument yaml strings.

Fixes #40684

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

k8s

@ansibot
Copy link
Contributor

ansibot commented May 25, 2018

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels May 25, 2018
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label May 25, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 25, 2018
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Jun 3, 2018
@ansibot ansibot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Jun 27, 2018
@fabianvf
Copy link
Contributor Author

@maxamillion anyway I can rekick this build?

@sivel
Copy link
Member

sivel commented Jun 28, 2018

kicked

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jun 28, 2018
@maxamillion maxamillion merged commit d75e496 into ansible:devel Jun 29, 2018
@fabianvf
Copy link
Contributor Author

fabianvf commented Jul 5, 2018

@maxamillion can we backport this to 2.6?

@towolf
Copy link
Contributor

towolf commented Aug 8, 2018

@fabianvf is this in 2.6.2?

I get this error:
msg: 'argument resource_definition is of type <type ''str''> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value'

When using this:

 - name: Remove old job                                           
   k8s:                                                                                
     definition: "{{ lookup('file', 'job.yaml') }}"  
     state: absent                                                

@fabianvf
Copy link
Contributor Author

fabianvf commented Aug 8, 2018

@towolf, no it was not backported

@dagwieers dagwieers added the k8s label Feb 8, 2019
@ansible ansible locked and limited conversation to collaborators Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. k8s module This issue/PR relates to a module. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k8s_raw module does not allow multiple Kubernetes objects in one file
7 participants