Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Lets Encrypt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
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
Ansible
Roles
Lets Encrypt
Commits
6bae6b21
Commit
6bae6b21
authored
7 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-playbooks/general#72 Always use import_tasks or include_tasks instead of just include
parent
992679f3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
handlers/main.yml
+1
-1
1 addition, 1 deletion
handlers/main.yml
tasks/cert.yml
+13
-45
13 additions, 45 deletions
tasks/cert.yml
tasks/cert_generate.yml
+37
-0
37 additions, 0 deletions
tasks/cert_generate.yml
tasks/main.yml
+4
-4
4 additions, 4 deletions
tasks/main.yml
tasks/renew.yml
+1
-1
1 addition, 1 deletion
tasks/renew.yml
with
56 additions
and
51 deletions
handlers/main.yml
+
1
−
1
View file @
6bae6b21
---
# file: roles/letsencrypt/handler/main.yml
-
i
nclude
:
'
../../haproxy/handlers/main.yml'
-
i
mport_tasks
:
'
../../haproxy/handlers/main.yml'
This diff is collapsed.
Click to expand it.
tasks/cert.yml
+
13
−
45
View file @
6bae6b21
---
# file: roles/letsencrypt/tasks/cert.yml
-
set_fact
:
cert={{ domain.1|default(domain) }}
-
set_fact
:
port={{ ('proxyserver' in groups)|ternary(54321,80) }}
-
name
:
"
Write
Config"
template
:
src
:
'
letsencrypt.ini'
dest
:
'
/etc/letsencrypt/{{
cert.domain
}}.ini'
owner
:
'
root'
group
:
'
root'
mode
:
'
644'
register
:
cert_definition
-
block
:
-
name
:
"
Stop
services"
service
:
name
:
'
{{
item
}}'
state
:
'
stopped'
with_items
:
'
{{
letsencrypt_pause_services|default([])
}}'
-
name
:
"
Open
Port"
iptables
:
chain
:
'
INPUT'
source
:
'
0.0.0.0'
destination_port
:
54321
protocol
:
'
tcp'
jump
:
'
ACCEPT'
state
:
'
present'
-
name
:
"
Install
New
Cert"
shell
:
certbot certonly --expand --non-interactive --config /etc/letsencrypt/{{ cert.domain }}.ini --http-01-port {{ port }} --preferred-challenges http-01
ignore_errors
:
true
-
set_fact
:
cert={{ domain.1|default(domain) }}
-
set_fact
:
port={{ ('proxyserver' in groups)|ternary(54321,80) }}
-
name
:
"
Close
Port
"
iptables
:
chain
:
'
INPUT
'
source
:
'
0.0.0.0
'
destination_port
:
54321
p
ro
tocol
:
'
tcp
'
jump
:
'
ACCEPT
'
state
:
'
absent'
-
name
:
"
Write
Config
"
template
:
src
:
'
letsencrypt.ini
'
dest
:
'
/etc/letsencrypt/{{
cert.domain
}}.ini
'
owner
:
'
root'
g
ro
up
:
'
root
'
mode
:
'
644
'
register
:
cert_definition
-
name
:
"
Start
services"
service
:
name
:
'
{{
item
}}'
state
:
'
started'
with_items
:
'
{{
letsencrypt_pause_services|default([])
}}'
ignore_errors
:
true
-
import_tasks
:
cert_generate.yml
when
:
cert_definition.changed
when
:
cert_definition.changed
tags
:
'
ApacheConfig'
This diff is collapsed.
Click to expand it.
tasks/cert_generate.yml
0 → 100644
+
37
−
0
View file @
6bae6b21
---
# file: roles/letsencrypt/tasks/cert_generate.yml
-
name
:
"
Stop
services"
service
:
name
:
'
{{
item
}}'
state
:
'
stopped'
with_items
:
'
{{
letsencrypt_pause_services|default([])
}}'
-
name
:
"
Open
Port"
iptables
:
chain
:
'
INPUT'
source
:
'
0.0.0.0'
destination_port
:
54321
protocol
:
'
tcp'
jump
:
'
ACCEPT'
state
:
'
present'
-
name
:
"
Install
New
Cert"
shell
:
certbot certonly --expand --non-interactive --config /etc/letsencrypt/{{ cert.domain }}.ini --http-01-port {{ port }} --preferred-challenges http-01
ignore_errors
:
true
-
name
:
"
Close
Port"
iptables
:
chain
:
'
INPUT'
source
:
'
0.0.0.0'
destination_port
:
54321
protocol
:
'
tcp'
jump
:
'
ACCEPT'
state
:
'
absent'
-
name
:
"
Start
services"
service
:
name
:
'
{{
item
}}'
state
:
'
started'
with_items
:
'
{{
letsencrypt_pause_services|default([])
}}'
ignore_errors
:
true
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
4
−
4
View file @
6bae6b21
...
...
@@ -20,18 +20,18 @@
changed_when
:
false
tags
:
'
always'
-
i
nclude
:
install.yml
-
i
mport_tasks
:
install.yml
-
include
:
cert.yml
-
include
_tasks
:
cert.yml
with_items
:
'
{{
letsencrypt_certificates|default([])
}}'
loop_control
:
loop_var
:
domain
-
i
nclude
:
renew.yml
-
i
mport_tasks
:
renew.yml
when
:
letsencrypt_certs_available is defined and letsencrypt_certs_available.stat.exists and (proxy_active is not defined or proxy_active)
tags
:
'
renew'
-
i
nclude
_tasks
:
'
../../haproxy/tasks/proxypool.yml'
-
i
mport
_tasks
:
'
../../haproxy/tasks/proxypool.yml'
tags
:
'
renew'
when
:
'
"letsencrypt"
not
in
excluded_roles'
This diff is collapsed.
Click to expand it.
tasks/renew.yml
+
1
−
1
View file @
6bae6b21
...
...
@@ -34,7 +34,7 @@
state
:
'
absent'
-
name
:
"
Build
HaProxy
Certs"
i
nclude
_tasks
:
'
../../haproxy/tasks/buildcerts.yml'
i
mport
_tasks
:
'
../../haproxy/tasks/buildcerts.yml'
tags
:
'
always'
-
name
:
"
Start
services"
...
...
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