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

set defautStorageClass = nfs-client #82

Merged
merged 2 commits into from
May 15, 2020
Merged

set defautStorageClass = nfs-client #82

merged 2 commits into from
May 15, 2020

Conversation

j0hnL
Copy link
Collaborator

@j0hnL j0hnL commented May 15, 2020

this will close issue #81

Signed-off-by: John Lockman jlockman3@gmail.com

this will close issue #81

Signed-off-by: John Lockman <jlockman3@gmail.com>
@j0hnL j0hnL linked an issue May 15, 2020 that may be closed by this pull request
@j0hnL j0hnL requested a review from lwilson May 15, 2020 18:15
@lwilson
Copy link
Collaborator

lwilson commented May 15, 2020

Hey @j0hnL, looking at the implementation, it appears as though the kubectl patch command could have been inserted directly into a play using the shell module. Any particular reason for the standalone script?

Also, should we explore some of the more modern Ansible modules for kubernetes? I believe we can use the k8s module (https://docs.ansible.com/ansible/latest/modules/k8s_module.html) and the merge command.

@j0hnL
Copy link
Collaborator Author

j0hnL commented May 15, 2020

it looks like the k8s module is specific to OpenShift

Uses the OpenShift Python client to perform CRUD operations on K8s objects.

Had problems using the shell module because of : in the command. Ansible barfs on that and thinks it's an operator.

@lwilson
Copy link
Collaborator

lwilson commented May 15, 2020

You should be able to escape the colon by surrounding the command in quotes:
shell: "kubectl patch storageclasses.storage.k8s.io nfs-client -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'"

see https://stackoverflow.com/questions/40936360/syntax-error-on-colon-in-ansible-command-argument

@lwilson lwilson added this to the v0.2 milestone May 15, 2020
Signed-off-by: John Lockman <jlockman3@gmail.com>
@lwilson
Copy link
Collaborator

lwilson commented May 15, 2020

I think this is a much better solution than the helper file. Approve and merged.

@lwilson lwilson merged commit d1848f0 into dell:devel May 15, 2020
@j0hnL j0hnL deleted the issue-81 branch May 15, 2020 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark nfs-provisioner as default StorageClass
2 participants