Skip to content

“An Ansible playbook to install Lego, automatically solve ACME challenges, and obtain SSL certificates.”

Notifications You must be signed in to change notification settings

MatinZ626/GoCertify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Playbook – SSL Certificates with Lego (Let's Encrypt)

This Ansible playbook automates the installation and configuration of Lego, a Let's Encrypt client written in Go, to obtain SSL/TLS certificates using DNS-01 challenges.
It currently supports the following DNS providers:

  • Cloudflare
  • ArvanCloud

🚀 Features

  • Installs Lego on the target host.
  • Automates the DNS-01 ACME challenge.
  • Requests and renews SSL/TLS certificates from Let's Encrypt.

🌐 Cloudflare API

  1. Log in to your Cloudflare account.
  2. Click on "Manage Account" and then choose "Account API Tokens".
  3. Click on "Create Token".
  4. Use the "Edit zone DNS" template.
  5. Add permissions: Zone:Edit and Zone:Read.
  6. Save the API token securely.

🌐 ArvanCloud API

Follow ArvanCloud documentation to:

  1. Create a machine user with an API key.
  2. Create an access policy with the DNS Management permission.

🔑 Obtaining the SSL Certificate

  1. Add your first host (example below) in:
inventory/hosts.ini
  1. Create a config file by copying:
host_vars/example.yml
  1. Edit the new file with your own data.

  2. Run the playbook:

ansible-playbook -i ./inventory/hosts.ini lego.yml -vvv

📂 The new certificates will be stored in:

~/.lego/certificates/

🙌 Contributions

Pull requests and issues are welcome!

About

“An Ansible playbook to install Lego, automatically solve ACME challenges, and obtain SSL certificates.”

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published