-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from DnR-iData/master
http-01 wellknown support + ansible galaxy file structure :
- Loading branch information
Showing
13 changed files
with
166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# handlers file for sitewards.ansible-role-lets-encrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
galaxy_info: | ||
author: Sitewards & DnR-iData | ||
description: Let's Encrypt roles | ||
company: Sitewards | ||
|
||
# If the issue tracker for your role is not on github, uncomment the | ||
# next line and provide a value | ||
# issue_tracker_url: http://example.com/issue/tracker | ||
|
||
# Some suggested licenses: | ||
# - BSD (default) | ||
# - MIT | ||
# - GPLv2 | ||
# - GPLv3 | ||
# - Apache | ||
# - CC-BY | ||
license: license (GPLv2, CC-BY, etc) | ||
|
||
min_ansible_version: 2.4 | ||
|
||
# If this a Container Enabled role, provide the minimum Ansible Container version. | ||
# min_ansible_container_version: | ||
|
||
# Optionally specify the branch Galaxy will use when accessing the GitHub | ||
# repo for this role. During role install, if no tags are available, | ||
# Galaxy will use this branch. During import Galaxy will access files on | ||
# this branch. If Travis integration is configured, only notifications for this | ||
# branch will be accepted. Otherwise, in all cases, the repo's default branch | ||
# (usually master) will be used. | ||
#github_branch: | ||
|
||
# | ||
# platforms is a list of platforms, and each platform has a name and a list of versions. | ||
# | ||
# platforms: | ||
# - name: Fedora | ||
# versions: | ||
# - all | ||
# - 25 | ||
# - name: SomePlatform | ||
# versions: | ||
# - all | ||
# - 1.0 | ||
# - 7 | ||
# - 99.99 | ||
|
||
galaxy_tags: [] | ||
# List tags for your role here, one per line. A tag is a keyword that describes | ||
# and categorizes the role. Users find roles by searching for tags. Be sure to | ||
# remove the '[]' above, if you add tags to this list. | ||
# | ||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
# Maximum 20 tags per role. | ||
|
||
dependencies: [] | ||
# List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
# if you add dependencies to this list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Ensure HAProxy SSL dir exist | ||
become: true | ||
file: | ||
path: /etc/haproxy/ssl | ||
state: directory | ||
when: lets_encrypt_certificate_invalidated == true | ||
|
||
# TODO : change raw modules with assemble or other. | ||
# Concatenate crt & key fort HAProxy SSL Support | ||
- name: Assemble key and crt for HAProxy | ||
become: true | ||
raw: cat /etc/ssl/certs/{{ lets_encrypt_resource_name }}.fullchain.crt /etc/ssl/private/{{ lets_encrypt_resource_name }}.key > /etc/haproxy/ssl/{{ lets_encrypt_resource_name }}.pem | ||
when: lets_encrypt_certificate_invalidated == true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,28 @@ | ||
--- | ||
- include: "dependencies.yml" | ||
|
||
# Create the /.well-known/acme-challenge dir | ||
- include: "wellknown.yml" | ||
vars: | ||
lets_encrypt_resource_state: present | ||
when: | ||
- lets_encrypt_challenge_type == 'http-01' | ||
|
||
|
||
- include: "lets_encrypt.yml" | ||
when: lets_encrypt_common_name is not undefined | ||
|
||
|
||
# Remove the /.well-known/acme-challenge dir | ||
- include: "wellknown.yml" | ||
vars: | ||
lets_encrypt_resource_state: absent | ||
when: | ||
- lets_encrypt_challenge_type == 'http-01' | ||
|
||
# Concatenate crt & key for HAproxy SSL support | ||
- include: "haproxy.yml" | ||
when: | ||
- lets_encrypt_ssl_mode == 'haproxy' | ||
- lets_encrypt_common_name is not undefined | ||
- lets_encrypt_challenge_type == 'http-01' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
## Creating & adding the well-known acme-challenge file with data | ||
|
||
- name: Copy HTTP well-known ACME Challege data to file | ||
copy: | ||
content: "{{ acme_data.challenge_data[lets_encrypt_resource_domain]['http-01']['resource_value'] }}" | ||
dest: "{{ lets_encrypt_http_path }}/{{ acme_data.challenge_data[lets_encrypt_resource_domain]['http-01']['resource'] }}" | ||
when: lets_encrypt_resource_state == "present" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
|
||
- set_fact: | ||
dir_state: "{{ lets_encrypt_resource_state }}" | ||
|
||
- set_fact: | ||
dir_state: "directory" | ||
when: lets_encrypt_resource_state == "present" | ||
|
||
- name: Ensure well-known dir exist | ||
file: | ||
path: "{{ lets_encrypt_http_path }}/.well-known" | ||
state: "{{ dir_state }}" | ||
|
||
- name: Ensure acme-challenge dir exist | ||
file: | ||
path: "{{ lets_encrypt_http_path }}/.well-known/acme-challenge" | ||
state: "{{ dir_state }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
localhost | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- sitewards.ansible-role-lets-encrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# vars file for sitewards.ansible-role-lets-encrypt |