Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
haproxy
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Eric Zillmann
haproxy
Commits
0a938de1
Commit
0a938de1
authored
8 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Renew letsencrypt certs only on active proxy and rsync them to the inactive ones
parent
622c3484
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
tasks/main.yml
+25
-1
25 additions, 1 deletion
tasks/main.yml
tasks/pullcerts.yml
+33
-0
33 additions, 0 deletions
tasks/pullcerts.yml
with
58 additions
and
1 deletion
tasks/main.yml
+
25
−
1
View file @
0a938de1
...
...
@@ -27,5 +27,29 @@
-
name
:
"
Build
HaCerts"
include
:
'
buildcerts.yml'
-
name
:
"
Set
directory
permissions
to
current
user"
file
:
path
:
'
/etc/letsencrypt'
owner
:
'
{{
ansible_env.SUDO_USER
}}'
recurse
:
yes
tags
:
Certs
when
:
proxy_active
tags
:
Certs
when
:
'
proxy_active
and
"letsencrypt"
not
in
excluded_roles'
-
block
:
-
name
:
"
Pull
Certs
from
active
Proxy"
include
:
'
pullcerts.yml'
tags
:
Certs
when
:
'
not
proxy_active
and
"letsencrypt"
not
in
excluded_roles'
-
name
:
"
Set
directory
permissions
to
root"
file
:
path
:
'
/etc/letsencrypt'
owner
:
'
root'
recurse
:
yes
tags
:
Certs
when
:
'
"letsencrypt"
not
in
excluded_roles'
when
:
'
false
and
proxy_active
and
"letsencrypt"
not
in
excluded_roles'
This diff is collapsed.
Click to expand it.
tasks/pullcerts.yml
0 → 100644
+
33
−
0
View file @
0a938de1
---
# file: roles/haproxy/tasks/pullcerts.yml
-
name
:
"
Find
out
active
proxy"
set_fact
:
proxy_active_host={{ item }}
with_items
:
'
{{
groups.proxyserver
}}'
when
:
hostvars[item].proxy_active
-
name
:
"
Set
directory
permissions
to
current
user"
file
:
path
:
'
{{
item
}}'
owner
:
'
{{
ansible_env.SUDO_USER
}}'
recurse
:
yes
with_items
:
-
'
/etc/letsencrypt'
-
'
/etc/haproxy/certs'
-
name
:
"
Sync
files"
shell
:
rsync -r '{{ proxy_active_host }}:{{ item }}/' '{{ item }}'
delegate_to
:
"
{{
inventory_hostname
}}"
become
:
no
with_items
:
-
'
/etc/letsencrypt'
-
'
/etc/haproxy/certs'
-
name
:
"
Set
directory
permissions
to
root"
file
:
path
:
'
{{
item
}}'
owner
:
'
root'
recurse
:
yes
with_items
:
-
'
/etc/letsencrypt'
-
'
/etc/haproxy/certs'
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