-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e14d6eb
commit 5da6dd1
Showing
7 changed files
with
34 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,28 +7,31 @@ certbot_auto_renew_minute: 30 | |
certbot_auto_renew_options: "--quiet --no-self-upgrade" | ||
|
||
# Parameters used when creating new Certbot certs. | ||
certbot_create_if_missing: no | ||
certbot_create_if_missing: false | ||
certbot_create_method: standalone | ||
certbot_admin_email: [email protected] | ||
certbot_certs: [] | ||
# - email: [email protected] | ||
# domains: | ||
# - example1.com | ||
# - example2.com | ||
# - domains: | ||
# - example3.com | ||
certbot_create_command: "{{ certbot_script }} certonly --standalone --noninteractive --agree-tos --email {{ cert_item.email | default(certbot_admin_email) }} -d {{ cert_item.domains | join(',') }}" | ||
# - email: [email protected] | ||
# domains: | ||
# - example1.com | ||
# - example2.com | ||
# - domains: | ||
# - example3.com | ||
certbot_create_command: >- | ||
"{{ certbot_script }} certonly --standalone --noninteractive --agree-tos | ||
--email {{ cert_item.email | default(certbot_admin_email) }} | ||
-d {{ cert_item.domains | join(',') }}" | ||
certbot_create_standalone_stop_services: | ||
- nginx | ||
# - apache | ||
# - varnish | ||
|
||
# To install from source (on older OSes or if you need a specific or newer | ||
# version of Certbot), set this variable to `yes` and configure other options. | ||
certbot_install_from_source: no | ||
certbot_install_from_source: false | ||
certbot_repo: https://github.com/certbot/certbot.git | ||
certbot_version: master | ||
certbot_keep_updated: yes | ||
certbot_keep_updated: true | ||
|
||
# Where to put Certbot when installing from source. | ||
certbot_dir: /opt/certbot |
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 |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
|
||
roles: | ||
- geerlingguy.git | ||
- geerlingguy.certbot | ||
- geerlingguy.certbot |
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
# Play 1: Provision EC2 instance and A record. | ||
- hosts: localhost | ||
connection: local | ||
gather_facts: no | ||
gather_facts: false | ||
|
||
tasks: | ||
- name: Configure EC2 Security Group. | ||
|
@@ -50,9 +50,10 @@ | |
Name: "certbot-standalone-nginx-test" | ||
group: ['default', 'certbot_test_http'] | ||
instance_type: t2.micro | ||
image: ami-02e98f78 # CentOS Linux 7 x86_64 HVM EBS | ||
# CentOS Linux 7 x86_64 HVM EBS | ||
image: ami-02e98f78 | ||
region: "us-east-1" | ||
wait: yes | ||
wait: true | ||
wait_timeout: 500 | ||
exact_count: 1 | ||
count_tag: | ||
|
@@ -68,25 +69,25 @@ | |
type: A | ||
ttl: 300 | ||
value: "{{ created_instance.tagged_instances.0.public_ip }}" | ||
wait: yes | ||
overwrite: yes | ||
wait: true | ||
overwrite: true | ||
|
||
- name: Add EC2 instance to inventory groups. | ||
add_host: | ||
name: "certbot-test.servercheck.in" | ||
groups: "aws,aws_nginx" | ||
ansible_ssh_user: centos | ||
host_key_checking: False | ||
host_key_checking: false | ||
when: created_instance.tagged_instances.0.id is defined | ||
|
||
# Play 2: Configure EC2 instance with Certbot and Nginx. | ||
- hosts: aws_nginx | ||
gather_facts: yes | ||
become: yes | ||
gather_facts: true | ||
become: true | ||
|
||
vars: | ||
certbot_admin_email: [email protected] | ||
certbot_create_if_missing: yes | ||
certbot_create_if_missing: true | ||
certbot_create_standalone_stop_services: [] | ||
certbot_certs: | ||
- domains: | ||
|
@@ -107,7 +108,7 @@ | |
pre_tasks: | ||
- name: Update apt cache. | ||
apt: update_cache=yes cache_valid_time=600 | ||
apt: update_cache=true cache_valid_time=600 | ||
when: ansible_os_family == 'Debian' | ||
changed_when: false | ||
|
||
|
@@ -135,12 +136,12 @@ | |
url: https://certbot-test.servercheck.in/ | ||
status_code: 200 | ||
delegate_to: localhost | ||
become: no | ||
become: false | ||
|
||
# Play 3: Tear down EC2 instance and A record. | ||
- hosts: localhost | ||
connection: local | ||
gather_facts: no | ||
gather_facts: false | ||
|
||
tasks: | ||
- name: Destroy EC2 instance. | ||
|
@@ -149,7 +150,7 @@ | |
instance_ids: ["{{ created_instance.tagged_instances.0.id }}"] | ||
region: "us-east-1" | ||
state: absent | ||
wait: yes | ||
wait: true | ||
wait_timeout: 500 | ||
|
||
- name: Delete Security Group. | ||
|
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 |
---|---|---|
|
@@ -21,4 +21,4 @@ | |
when: ansible_os_family == 'Debian' | ||
|
||
roles: | ||
- geerlingguy.certbot | ||
- geerlingguy.certbot |
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 +1,2 @@ | ||
--- | ||
certbot_package: letsencrypt |