Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
b77b4eb8
Commit
b77b4eb8
authored
4 years ago
by
Zuul
Committed by
Gerrit Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Fix keystone-startup.sh - remove Fernet key age check"
parents
a081fba3
ba8c27f5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/roles/keystone/templates/keystone-startup.sh.j2
+7
-18
7 additions, 18 deletions
ansible/roles/keystone/templates/keystone-startup.sh.j2
releasenotes/notes/fix-keystone-startup-66c5aa11a464a562.yaml
+8
-0
8 additions, 0 deletions
...asenotes/notes/fix-keystone-startup-66c5aa11a464a562.yaml
with
15 additions
and
18 deletions
ansible/roles/keystone/templates/keystone-startup.sh.j2
+
7
−
18
View file @
b77b4eb8
...
@@ -4,32 +4,21 @@
...
@@ -4,32 +4,21 @@
set
-o
errexit
set
-o
errexit
set
-o
pipefail
set
-o
pipefail
TO
KE
N
_DIR
=
"/etc/keystone/fernet-keys"
FERNET_
KE
Y
_DIR
=
"/etc/keystone/fernet-keys"
# Ensure
to
ke
n
s are populated, check for 0 (staging) key
# Ensure
Fernet
ke
y
s are populated, check for 0 (staging) key
n
=
0
n
=
0
while
[
!
-f
"
${
TO
KE
N
_DIR
}
/0"
]
;
do
while
[
!
-f
"
${
FERNET_
KE
Y
_DIR
}
/0"
]
;
do
if
[
$n
-lt
36
]
;
then
if
[
$n
-lt
36
]
;
then
n
=
$((
n
+
1
))
n
=
$((
n
+
1
))
echo
"ERROR: Fernet
to
ke
n
s have not been populated, rechecking in 5 seconds"
echo
"ERROR: Fernet ke
y
s have not been populated, rechecking in 5 seconds"
echo
"DEBUG:
${
TO
KE
N
_DIR
}
contents:"
echo
"DEBUG:
${
FERNET_
KE
Y
_DIR
}
contents:"
ls
-l
${
TO
KE
N
_DIR
}
ls
-l
${
FERNET_
KE
Y
_DIR
}
sleep
5
sleep
5
else
else
echo
"CRITICAL: Waited for
10
minutes - failing"
echo
"CRITICAL: Waited for
3
minutes - failing"
exit
1
exit
1
fi
fi
done
done
# Ensure tokens are not stale
# Get primary token (file with highest number)
TOKEN_PRIMARY
=
$(
ls
-1
${
TOKEN_DIR
}
|
sort
-hr
|
head
-n
1
)
# Check it's age in seconds
TOKEN_AGE
=
$((
$(
date
+%s
)
-
$(
date
+%s
-r
"
${
TOKEN_DIR
}
/
${
TOKEN_PRIMARY
}
"
)
))
# Compare if it's older than fernet_key_rotation_interval and fail if it's stale
if
[
"
${
TOKEN_AGE
}
"
-gt
"{{ fernet_key_rotation_interval }}"
]
;
then
echo
"ERROR: Primary token
${
TOKEN_PRIMARY
}
is stale."
exit
1
fi
exec
/usr/sbin/
{{
keystone_cmd
}}
$@
exec
/usr/sbin/
{{
keystone_cmd
}}
$@
This diff is collapsed.
Click to expand it.
releasenotes/notes/fix-keystone-startup-66c5aa11a464a562.yaml
0 → 100644
+
8
−
0
View file @
b77b4eb8
---
fixes
:
-
|
Fixes an issue with Keystone startup when Fernet key rotation does not
occur within the configured interval. This may happen due to one of the
Keystone hosts being down at the scheduled time of rotation, or due to
uneven intervals between cron jobs. `LP#1895723
<https://bugs.launchpad.net/kolla-ansible/+bug/1895723>`__
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