Commit Graph
62 Commits
Author SHA1 Message Date
Abhijeet KasurdeandGitHub ef6722d290 helm: Add support for K8S_AUTH_CONTEXT, K8S_AUTH_KUBECONFIG env (#141)
Added support for K8S_AUTH_CONTEXT, K8S_AUTH_KUBECONFIG env
2020-07-02 18:48:41 +05:30
Jeff Geerling 881ca3d006 Fixes #145: Use FQCN in module docs and in plugin examples. 2020-06-29 16:25:42 -05:00
Abhijeet KasurdeandGitHub 9fb808c7f3 k8s: Fix a bug when manifest file ends with '---' (#139)
Any kubernetes manifest file ending with '---' will
generate an error when applied using 'k8s' module.

Although this may not be 'legal' YAML, this is quite frequent,
specially on helm's generated manifest files.

migrated from https://github.com/ansible/ansible/pull/59160

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-25 09:11:03 +10:00
Abhijeet Kasurde 5b7046470e helm: Add option 'atomic'
helm command provides option to remove installation on failure using
'atomic' flag.
This fix adds this parameter in helm module.

Fixes: #109

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-18 17:01:45 +05:30
Abhijeet KasurdeandGitHub 3004c8d3f0 Handle invalid kubeconfig parsing error (#119)
Provide message to user about invalid or empty kubeconfig
by handling exception raised by kubernetes Python API

Fixes: #90

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-16 11:03:08 +05:30
Jeff GeerlingandGitHub 0e92889d34 Merge pull request #123 from willthames/flake8
Flake8
2020-06-15 12:34:46 -05:00
Will Thames 510a069de9 F841 remove unused variables 2020-06-09 19:00:21 +10:00
Will Thames 43ae9664fc W504 Move binary operator to start of line from end of line
PEP8 prefers binary operators at the start of a line
https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
2020-06-09 19:00:21 +10:00
Will Thames 59348066a0 F401: Remove unused imports 2020-06-09 19:00:21 +10:00
Will Thames 4b7db6f7f9 Use improved kubernetes diffs where possible
Use information from strategic merges to improve
the quality of diffs, particularly for list items
(order no longer important, and adding/removing an
item from a list just shows that item in the diff,
not the whole list)
2020-06-08 19:35:59 +10:00
Abhijeet KasurdeandGitHub 18dfb687e6 Handle set object retrieved from lookup plugin (#118)
api_groups is returned as "dict_keys()" which k8s lookip plugin does not handle.
Typecasting with list make it available to default callback plugin.
2020-06-05 12:18:57 +05:30
Abhijeet KasurdeandGitHub c8ef0ae1ad Minor refactor in helm_info and helm_repository (#117)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-05 12:16:56 +05:30
Abhijeet KasurdeandGitHub 3078131db5 Minor doc fixes (#114)
* Spelling fixes
* Documentation update
* Example update to use FQCN

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-05 11:32:26 +05:30
Fabian von FeilitzschandGitHub 01399ea840 Merge pull request #110 from Akasurde/helm_fix
helm: minor code refactoring
2020-06-04 11:48:40 -04:00
Abhijeet KasurdeandGitHub 9a952697a2 Minor documentation fix (#113)
Inventory plugin example should read 'api_key' instead of 'token'

Fixes: #101

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-02 15:49:04 +10:00
Abhijeet Kasurde 641fbd92f5 helm: minor code refactoring
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-01 18:55:30 +05:30
Will Thames beebe98ce6 Fix scale wait and add tests
Move wait logic out of raw and into common and use that
logic in scale

Fix a few broken wait condition cases highlighted by scaling
up and down

Move scale-related tests into dedicated test task file

Additional service related tests
2020-05-22 12:39:43 +10:00
Toshio Kuratomi d9ece473dd Fix the docs for the inventory plugins.
Documenting the structure of the dictionary to pass in needs to be done
via suboptions rather than putting the structure directoly inside of the
toplevel option.
2020-05-20 07:48:35 -07:00
Fabian von FeilitzschandGitHub 2f7b55270d Merge pull request #35 from willthames/wait_conditions
Make deployments and daemonsets wait for pods to be ready
2020-05-19 13:38:35 -04:00
Fabian von FeilitzschandGitHub 9ccec43c6e Merge pull request #84 from willthames/k8s_apply_check_mode_fix
K8s apply check mode fix
2020-05-15 12:58:40 -04:00
Will Thames 35ffd0e431 Improve k8s Deployment and Daemonset wait conditions
Ensure that Deployments and Daemonsets properly await
all replicas to be available. Correctly handles the
subtle edge case when a service account no longer exists.

Note that this will dramatically slow Daemonset updates
2020-05-15 09:24:35 +10:00
Jeff Geerling aad3ec7ad5 Add version_added to docs for each of the new collection modules. 2020-05-14 09:39:17 -05:00
Jeff Geerling 3e60ccacc3 Fixes #96: Sanity test finds incorrect deprecated usage. 2020-05-14 09:20:00 -05:00
Örjan Sjöholm f45d33224f Remove ANSIBLE_METADATA
The meta data field is deprecated and is not used anymore.

See ansible-collections/overview#57 for more details.
2020-05-14 14:25:07 +02:00
Will Thames 34137c40c2 Fix apply patching results in check mode
apply_object returns only the patch - we need to actually
apply the patch to the existing object.

Fixes ansible/ansible#66780
2020-05-04 18:48:13 +10:00
LucasBoisserie 1a23994448 Add helm_repository module and fix review suggestion 2020-04-25 12:24:26 +02:00
LucasBoisserie e89aa1c692 Fix englist grammar errors and rename modules to helm and helm_info 2020-04-23 16:29:34 +02:00
LucasBoisserie 438a30bd8e Remove Helm 2 support and add tests for helm_cli_info 2020-04-23 15:52:12 +02:00
LucasBoisserie 2e1b0f6817 t# This is a combination of 2 commits.
Add requested changes for helm
2020-04-23 15:52:12 +02:00
LucasBoisserie 720326ebb4 Add helm_cli & helm_cli_info 2020-04-23 15:52:12 +02:00
Fabian von Feilitzsch 0f87f2b826 Fix linting errors 2020-03-31 15:14:07 -04:00
Fabian von Feilitzsch fe6480594e k8s_log no longer attempts to parse log as JSON
Fixes #68

Rather than relying on the default serialization logic (which attempts
    to parse a log as JSON and then load it into a wrapper class), we
now simply return the raw log data as expected. The previous behavior
worked in many cases because the log was serialized into a JSON string,
       but in the case of #68 the log was loaded as a JSON float, which
       made the error handling fail to fallback to returning the raw
       data.
2020-03-31 14:52:52 -04:00
Jeff Geerling 7aa071c98f Issue #49: Remaining fixes from diff on auto-migrated collection. 2020-03-20 15:42:13 -05:00
Jeff GeerlingandGitHub 78902af34a Merge pull request #56 from ansible-collections/49-missing-pr-65424
Fix examples to use from_yaml filter with lookup
2020-03-12 14:27:15 -05:00
Jeff GeerlingandGitHub 5924561afc Merge pull request #55 from ansible-collections/49-missing-pr-63219
k8s: persist refreshed tokens
2020-03-12 14:08:36 -05:00
Jeff GeerlingandGitHub c5ba4bb13a Merge pull request #54 from ansible-collections/49-missing-pr-60726
Add exception handling when retrieving k8s client
2020-03-12 14:07:23 -05:00
Baptiste Mille-MathiasandJeff Geerling 9b821a9333 Fix examples to use from_yaml filter with lookup 2020-03-12 13:55:07 -05:00
Fabrice RabauteandJeff Geerling 5cb93f16b6 k8s: persist refreshed tokens
When the ansible k8s module is refreshing the tokens from the local kube
config, it should save those token to the kube config file.

If this is not done, this might break the next kube client call as the
token in the local kube config file is not valid anymore and refreshing
can fail.

This commit is adding an env var K8S_AUTH_PERSIST_CONFIG that can be
used to set this flag to true (default is false, same as current
behavior).
2020-03-12 13:50:43 -05:00
Will ThamesandJeff Geerling d1c0b3a00d Add exception handling when retrieving k8s client 2020-03-12 13:44:06 -05:00
Danilo Riecken P. de Morais 3693656559 Fix docs for kubectl.py 2020-03-12 13:14:20 +01:00
Brian CocaandGitHub b75d6b7cc9 warn about disclosure when using certain options 2020-03-11 11:50:48 -04:00
Jeff Geerling b32e2609c0 Issue #33: Fix python lint issue with spacing. 2020-02-20 10:54:24 -06:00
Jeff Geerling 5417177436 Fixes #33: Add missing args and docs for src and apply parameters in k8s_service.py. 2020-02-20 10:54:24 -06:00
Fabian von Feilitzsch 875c5dfafe Update version 2020-02-18 15:20:30 -05:00
Fabian von Feilitzsch 14bc933a21 Add types to arguments 2020-02-18 13:26:56 -05:00
Fabian von Feilitzsch 75bf82d42c Fix paths to properly use FQCN where necessary 2020-02-18 12:04:29 -05:00
Fabian von Feilitzsch 373b0fc93c Also provide log_lines 2020-02-17 16:14:44 -05:00
Fabian von Feilitzsch b69e783b21 Add module for retrieving pod logs 2020-02-17 16:14:44 -05:00
Tristan Cacqueray eb50e6f6cd Fix k8s_exec mode 2020-02-14 14:13:49 -05:00
Tristan Cacqueray 5f1b88ba6f Update test variable name and k8s_exec version_added attribute 2020-02-14 18:28:16 +00:00