Skip to content

Commit

Permalink
Fix Ansible lint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Sep 27, 2018
1 parent e14d6eb commit 5da6dd1
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 29 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Currently there is one built-in method for generating new certificates using thi

**For a complete example**: see the fully functional test playbook in [tests/test-standalone-nginx-aws.yml](tests/test-standalone-nginx-aws.yml).

certbot_create_if_missing: no
certbot_create_if_missing: false
certbot_create_method: standalone

Set `certbot_create_if_missing` to `yes` or `True` to let this role generate certs. Set the method used for generating certs with the `certbot_create_method` variable—current allowed values include: `standalone`.
Expand Down Expand Up @@ -64,10 +64,10 @@ These services will only be stopped the first time a new cert is generated.

You can install Certbot from it's Git source repository if desired. This might be useful in several cases, but especially when older distributions don't have Certbot packages available (e.g. CentOS < 7, Ubuntu < 16.10 and Debian < 8).

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

Certbot Git repository options. To install from source, set `certbot_install_from_source` to `yes`. This clones the configured `certbot_repo`, respecting the `certbot_version` setting. If `certbot_keep_updated` is set to `yes`, the repository is updated every time this role runs.

Expand Down
23 changes: 13 additions & 10 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@example.com
certbot_certs: []
# - email: janedoe@example.com
# 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: janedoe@example.com
# 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
2 changes: 1 addition & 1 deletion molecule/default/playbook-source-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

roles:
- geerlingguy.git
- geerlingguy.certbot
- geerlingguy.certbot
27 changes: 14 additions & 13 deletions molecule/default/playbook-standalone-nginx-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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: https@servercheck.in
certbot_create_if_missing: yes
certbot_create_if_missing: true
certbot_create_standalone_stop_services: []
certbot_certs:
- domains:
Expand All @@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
when: ansible_os_family == 'Debian'

roles:
- geerlingguy.certbot
- geerlingguy.certbot
2 changes: 1 addition & 1 deletion tasks/install-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dest: "{{ certbot_dir }}"
version: "{{ certbot_version }}"
update: "{{ certbot_keep_updated }}"
force: yes
force: true

- name: Set Certbot script variable.
set_fact:
Expand Down
1 change: 1 addition & 0 deletions vars/Ubuntu-16.04.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
certbot_package: letsencrypt

0 comments on commit 5da6dd1

Please sign in to comment.