***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Datalab Openstack RKE2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HPC
DataLab
Ansible
Collections
Datalab Openstack RKE2
Commits
695a7c52
Commit
695a7c52
authored
3 years ago
by
Weber, Thomas
Browse files
Options
Downloads
Patches
Plain Diff
fix: token slurping not working
parent
b294d5b9
Branches
Branches containing commit
No related tags found
1 merge request
!1
Restore main as the default branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/rke2/tasks/config_rke2.yml
+19
-19
19 additions, 19 deletions
roles/rke2/tasks/config_rke2.yml
with
19 additions
and
19 deletions
roles/rke2/tasks/config_rke2.yml
+
19
−
19
View file @
695a7c52
-
name
:
create token
-
name
:
create token
delegate_to
:
localhost
delegate_to
:
localhost
run_once
:
yes
run_once
:
true
set_fact
:
set_fact
:
token
:
"
{{
lookup('community.general.random_string',
length=129,
special=False)
}}"
token
:
"
{{
lookup('community.general.random_string',
length=129,
special=False)
}}"
when
:
(not upgrade) and (token is not defined)
when
:
(not upgrade) and (token is not defined)
-
name
:
ensure inventory folders
-
name
:
ensure inventory folders
delegate_to
:
localhost
delegate_to
:
localhost
become
:
no
become
:
true
run_once
:
yes
run_once
:
false
file
:
file
:
path
:
"
{{
item
}}"
path
:
"
{{
item
}}"
state
:
directory
state
:
directory
...
@@ -17,26 +17,26 @@
...
@@ -17,26 +17,26 @@
-
group_vars/all
-
group_vars/all
-
name
:
slurp token if upgrade
-
name
:
slurp token if upgrade
block
:
-
name
:
Load token
slurp
:
src
:
"
/var/lib/rancher/rke2/server/node-token"
register
:
slurped_token
-
name
:
Decode token and store as fact at dummy master_host with host variable
add_host
:
name
:
"
MASTER_HOST"
token
:
"
{{
slurped_token.content
|
b64decode
|
trim
}}"
-
name
:
set token
delegate_to
:
localhost
run_once
:
yes
set_fact
:
token
:
"
{{
hostvars['MASTER_HOST']['token'].split('server:')[1]
}}"
when
:
upgrade and ('master' in group_names)
when
:
upgrade and ('master' in group_names)
block
:
-
name
:
Load token
slurp
:
src
:
"
/var/lib/rancher/rke2/server/node-token"
register
:
slurped_token
-
name
:
Decode token and store as fact at dummy master_host with host variable
add_host
:
name
:
"
MASTER_HOST"
token
:
"
{{
slurped_token.content
|
b64decode
|
trim
}}"
-
name
:
set token
delegate_to
:
localhost
run_once
:
true
set_fact
:
token
:
"
{{
hostvars['MASTER_HOST']['token'].split('server:')[1]
}}"
-
name
:
store token
-
name
:
store token
delegate_to
:
localhost
delegate_to
:
localhost
become
:
no
become
:
false
run_once
:
yes
run_once
:
true
copy
:
copy
:
dest
:
group_vars/all/token.yml
dest
:
group_vars/all/token.yml
content
:
|-
content
:
|-
...
...
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