Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
79f6cd77
Commit
79f6cd77
authored
2 years ago
by
Robin Wallace
Committed by
Kubernetes Prow Robot
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
create snapshot-controller only if needed
parent
c3c9a425
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
library/kube.py
+6
-1
6 additions, 1 deletion
library/kube.py
roles/kubernetes-apps/snapshots/snapshot-controller/tasks/main.yml
+14
-2
14 additions, 2 deletions
...ernetes-apps/snapshots/snapshot-controller/tasks/main.yml
with
20 additions
and
3 deletions
library/kube.py
+
6
−
1
View file @
79f6cd77
...
...
@@ -314,7 +314,7 @@ def main():
wait
=
dict
(
default
=
False
,
type
=
'
bool
'
),
all
=
dict
(
default
=
False
,
type
=
'
bool
'
),
log_level
=
dict
(
default
=
0
,
type
=
'
int
'
),
state
=
dict
(
default
=
'
present
'
,
choices
=
[
'
present
'
,
'
absent
'
,
'
latest
'
,
'
reloaded
'
,
'
stopped
'
]),
state
=
dict
(
default
=
'
present
'
,
choices
=
[
'
present
'
,
'
absent
'
,
'
latest
'
,
'
reloaded
'
,
'
stopped
'
,
'
exists
'
]),
recursive
=
dict
(
default
=
False
,
type
=
'
bool
'
),
),
mutually_exclusive
=
[[
'
filename
'
,
'
list
'
]]
...
...
@@ -339,6 +339,11 @@ def main():
elif
state
==
'
latest
'
:
result
=
manager
.
replace
()
elif
state
==
'
exists
'
:
result
=
manager
.
exists
()
module
.
exit_json
(
changed
=
changed
,
msg
=
'
%s
'
%
result
)
else
:
module
.
fail_json
(
msg
=
'
Unrecognized state %s.
'
%
state
)
...
...
This diff is collapsed.
Click to expand it.
roles/kubernetes-apps/snapshots/snapshot-controller/tasks/main.yml
+
14
−
2
View file @
79f6cd77
---
-
name
:
check if snapshot namespace exists
register
:
snapshot_namespace_exists
kube
:
kubectl
:
"
{{
bin_dir
}}/kubectl"
name
:
"
{{
snapshot_controller_namespace
}}"
resource
:
"
namespace"
state
:
"
exists"
when
:
inventory_hostname == groups['kube_control_plane'][0]
tags
:
snapshot-controller
-
name
:
Snapshot Controller | Generate Manifests
template
:
src
:
"
{{
item.file
}}.j2"
dest
:
"
{{
kube_config_dir
}}/{{
item.file
}}"
mode
:
0644
with_items
:
-
{
name
:
snapshot-ns
,
file
:
snapshot-ns.yml
}
-
{
name
:
snapshot-ns
,
file
:
snapshot-ns.yml
,
apply
:
not snapshot_namespace_exists
}
-
{
name
:
rbac-snapshot-controller
,
file
:
rbac-snapshot-controller.yml
}
-
{
name
:
snapshot-controller
,
file
:
snapshot-controller.yml
}
register
:
snapshot_controller_manifests
when
:
inventory_hostname == groups['kube_control_plane'][0]
when
:
-
inventory_hostname == groups['kube_control_plane'][0]
-
item.apply | default(True) | bool
tags
:
snapshot-controller
-
name
:
Snapshot Controller | Apply Manifests
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment