Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible-certbot
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
hdacloud
ansible-certbot
Commits
31380ef8
Commit
31380ef8
authored
1 year ago
by
blackphantom39
Browse files
Options
Downloads
Patches
Plain Diff
use renew hook to create fullchain cert
parent
664cfec3
No related branches found
No related tags found
1 merge request
!4
Fix fullchain creation
Pipeline
#161774
failed
1 year ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tasks/dns-challenge.yml
+8
-1
8 additions, 1 deletion
tasks/dns-challenge.yml
templates/dns-challenge.service.j2
+1
-3
1 addition, 3 deletions
templates/dns-challenge.service.j2
templates/renew-hook.sh.j2
+4
-0
4 additions, 0 deletions
templates/renew-hook.sh.j2
with
13 additions
and
4 deletions
tasks/dns-challenge.yml
+
8
−
1
View file @
31380ef8
...
...
@@ -38,6 +38,13 @@
-
/etc/letsencrypt/renewal-hooks/deploy
become
:
true
-
name
:
Render deploy hook script
ansible.builtin.template
:
src
:
templates/renew-hook.sh.j2
dest
:
/etc/letsencrypt/renewal-hooks/deploy/create-fullchain.sh
mode
:
0755
become
:
true
-
name
:
Request Cert If Necessary - DNS Challenge
when
:
not lecert.stat.exists
become
:
true
...
...
@@ -47,7 +54,7 @@
lego -a --dns {{ certbot_dns_provider }}
--email {{ certbot_admin_email }} -d {{ lego_dflag }}
--path {{ certbot_live_dir }}
run --no-bundle
run --no-bundle
--renew-hook /etc/letsencrypt/renewal-hooks/deploy/create-fullchain.sh
environment
:
"
{{
dns_provider_auth_env_variables
}}"
register
:
lego
changed_when
:
lego.rc ==
0
...
...
This diff is collapsed.
Click to expand it.
templates/dns-challenge.service.j2
+
1
−
3
View file @
31380ef8
...
...
@@ -5,10 +5,8 @@ Description=LEGO DNS challenge
[Service]
Type=oneshot
ExecStart=/usr/bin/lego -a --dns {{ certbot_dns_provider }} --email {{ certbot_admin_email }} -d {{ lego_dflag }} --path {{ certbot_live_dir }} renew --no-bundle
ExecStart=/usr/bin/lego -a --dns {{ certbot_dns_provider }} --email {{ certbot_admin_email }} -d {{ lego_dflag }} --path {{ certbot_live_dir }} renew --no-bundle
--renew-hook /etc/letsencrypt/renewal-hooks/deploy/create-fullchain.sh
ExecStartPost=cp {{ certbot_live_dir }}/certificates/{{ certbot_fqdn_first }}.crt {{ certbot_live_dir }}/cert.pem
ExecStartPost=cp {{ certbot_live_dir }}/certificates/{{ certbot_fqdn_first }}.key {{ certbot_live_dir }}/privkey.pem
ExecStartPost=cat {{ certbot_live_dir }}/certificates/{{ certbot_fqdn_first }}.crt >> {{ certbot_live_dir }}/fullchain.pem
ExecStartPost=cat {{ certbot_live_dir }}/certificates/{{ certbot_fqdn_first }}.issuer.crt >> {{ certbot_live_dir }}/fullchain.pem
{{ "ExecStartPost=/etc/letsencrypt/renewal-hooks/deploy/" + certbot_application if certbot_application is defined else "" }}
EnvironmentFile=/etc/default/dns-challenge.env
This diff is collapsed.
Click to expand it.
templates/renew-hook.sh.j2
0 → 100644
+
4
−
0
View file @
31380ef8
#!/usr/bin/env bash
cat
{{
certbot_live_dir
}}
/certificates/
{{
certbot_fqdn_first
}}
.crt
>>
{{
certbot_live_dir
}}
/fullchain.pem
cat
{{
certbot_live_dir
}}
/certificates/
{{
certbot_fqdn_first
}}
.issuer.crt
>>
{{
certbot_live_dir
}}
/fullchain.pem
\ No newline at end of file
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