Skip to content

A sample to provision Lets' Encrypt for Nginx on Ubuntu 18.04 by Ansible 2.9

Notifications You must be signed in to change notification settings

NyohoSampleCodes/letsencrypt-provisioning-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Let’s Encrypt provisioning sample

A sample to provision Lets’ Encrypt for Nginx on Ubuntu 18.04 by Ansible 2.9.

Ubuntu 18.04 に Ansible で Let’s Encrypt を設定するサンプル。

Strategy

  1. Put a configuration only to get certificates with certbot
  2. Do certbot with webroot
  3. Then change the configuration to a configuration with SSL

Usage

Write your machine name or an ip address to hosts.

Rewrite a list domains in ./roles/get-certs/tasks/main.yml and set letsencrypt_email as your email address.

- name: Get certs
  vars:
    domains:
      - hoge.example.net
      - fuga.example.net
    letsencrypt_email: [email protected]

And then do ansible-playbook.

ansible-playbook -i hosts site.yml

方法

  1. 一旦 certbot で証明書を取得するためだけの nginx 設定ファイルを設定する
  2. その状態で nginx を立ち上げて webroot で certbot する
  3. その後で SSL 設定付きの nginx 設定ファイルを書き込む

使い方

hosts ファイルにプロビジョニングしたいマシンを書き込みます。

./roles/get-certs/tasks/main.yml の中にある次の domains というリストを必要な分だけ書きます。 letsencrypt_email にメールアドレスも設定します。

- name: Get certs
  vars:
    domains:
      - hoge.example.net
      - fuga.example.net
    letsencrypt_email: [email protected]

そして ansible-playbook します。

ansible-playbook -i hosts site.yml

About

A sample to provision Lets' Encrypt for Nginx on Ubuntu 18.04 by Ansible 2.9

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published