Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
homelab
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shore
homelab
Commits
08422585
Commit
08422585
authored
4 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Recreate private keys every year.
The Let's Encrypt account key as well as the hosts' private keys.
parent
4fc0ce86
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1066
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/renew-cert.yaml
+26
-3
26 additions, 3 deletions
tasks/renew-cert.yaml
with
26 additions
and
3 deletions
tasks/renew-cert.yaml
+
26
−
3
View file @
08422585
...
...
@@ -5,10 +5,24 @@
-
domains is iterable
-
host is string
-
name
:
Gather facts
ansible.builtin.setup
:
gather_subset
:
-
date_time
-
name
:
Get account key file stat
ansible.builtin.stat
:
path
:
&account_key_src
account.key
register
:
account_key_stat
-
name
:
Generate account key
community.crypto.openssl_privatekey
:
# yamllint disable rule:line-length
force
:
|-
{{ (ansible_date_time.epoch|int - account_key_stat.stat.mtime|int)/(60*60*24*365) >= 4 }}
# yamllint enable rule:line-length
mode
:
0o0600
path
:
&
account_key_src
account.key
path
:
*
account_key_src
size
:
4096
state
:
present
type
:
RSA
...
...
@@ -33,11 +47,20 @@
tags
:
-
always
-
name
:
Get host key file stat
ansible.builtin.stat
:
path
:
&key_src
|-
{{ playbook_dir }}/{{ host }}.key
register
:
host_key_stat
-
name
:
Generate {{ host }} key
community.crypto.openssl_privatekey
:
# yamllint disable rule:line-length
force
:
|-
{{ (ansible_date_time.epoch|int - host_key_stat.stat.mtime|int)/(60*60*24*365) >= 4 }}
# yamllint enable rule:line-length
mode
:
&mode
0o0600
path
:
&key_src
|-
{{ playbook_dir }}/{{ host }}.key
path
:
*key_src
size
:
&size
4096
state
:
present
type
:
&type
RSA
...
...
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