Skip to content

Theme color

lego

Issue and renew ACME certificates with Lego on Linux or Windows.

giftpilz0.misc28 variables

Usage

playbook.yml
- hosts: all
roles:
- role: giftpilz0.misc.lego

Variables

  • private shared Lego state directory containing account keys and certificates.

    Default{{ 'C:\ProgramData\lego' if ansible_facts['os_family'] == 'Windows' else '/var/lib/lego' }}
  • Linux account used to run Lego.

    Defaultlego
  • Linux group used to run Lego.

    Defaultlego
  • Lego release version.

    Default5.5.2
  • Lego release architecture.

    Defaultamd64
  • Lego installation directory.

    Default{{ 'C:\ProgramData\lego\bin' if ansible_facts['os_family'] == 'Windows' else '/usr/local/bin' }}
  • Linux Lego archive URL.

    Defaulthttps://github.com/go-acme/lego/releases/download/v{{ lego_tag }}/lego_v{{ lego_tag }}_linux_{{ lego_arch }}.tar.gz
  • Windows Lego archive URL.

    Defaulthttps://github.com/go-acme/lego/releases/download/v{{ lego_tag }}/lego_v{{ lego_tag }}_windows_{{ lego_arch }}.zip
  • Windows identities allowed to access private Lego state.

    Default
    - user: SYSTEM
      rights: FullControl
    - user: Administrators
      rights: FullControl
    • userstrrequired

      Windows identity receiving access.

    • rightsstrrequired

      Windows filesystem rights to grant.

  • Windows identity used by the scheduled renewal task.

    DefaultSYSTEM
  • Windows scheduled-task logon type.

    Choicesservice_accountpasswords4uinteractive_token
    Defaultservice_account
  • Password for a password-based scheduled-task identity.

    Default""
  • Lego executable path.

    Default{{ lego_path }}/lego
  • whether to install Lego or use an existing binary.

    Choicespresentskip
    Defaultpresent
  • issue missing certificates immediately when the role is applied.

    Defaultfalse
  • renew certificates when fewer than this many days remain.

    Default30
  • ACME account email address.

    Default""
  • ACME directory URL.

    Defaulthttps://acme-v02.api.letsencrypt.org/directory
  • DNS resolvers passed to Lego for DNS-01 validation.

    Default[]
  • certificates to issue; each entry must define domains and a challenge.

    Default[]
    • namestrrequired

      unique identifier used for generated environment files and deployment markers.

    • domainslist[str]required

      domain names included in the certificate; the first domain names the output files.

    • Lego private-key type.

      ChoicesRSA2048RSA3072RSA4096EC256EC384EC521
    • optional ACME account directory identifier when one email uses multiple accounts.

    • per-certificate renewal settings.

      • override the global renewal threshold in days.

    • challengedictrequired

      ACME challenge method and provider credentials.

      • typestrrequired

        ACME validation method.

        Choicesdns-01http-01tls-alpn-01
      • Lego DNS provider name; required for dns-01.

      • provider environment variables, normally populated from Ansible Vault.

    • deploydict

      optional certificate deployment targets.

      • pemdict

        Linux PEM deployment.

      • pfxdict

        PFX deployment for Windows or applications that consume a PFX file.

        • pathpathrequired

          target PFX path.

        • passwordstrrequired

          password used to protect the PFX.

        • owner of the PFX on Linux.

        • group of the PFX on Linux.

        • modestr

          mode of the PFX on Linux.

        • parent directory mode on Linux.

      • optional Windows certificate-store import for a deployed PFX.

        • Windows certificate-store location.

          ChoicesCurrentUserLocalMachine
        • Windows certificate-store name.

    • hooksdict

      commands run only after a changed certificate is deployed.

      • changedlist[dict]
        • typestr

          informational; Linux runs command, Windows runs script.

          Choicescommandpowershell
        • shell command used by a Linux hook.

        • PowerShell script used by a Windows hook.

    • extra_argslist[str]

      additional Lego arguments for this certificate.

  • values for keys missing in lego_certificates entries (merged recursively).

    Default
    key_type: EC256
    account_id: '{{ lego_acme_email }}'
    extra_args: []
    renewal:
      threshold: '{{ lego_renewal_threshold }}'
    challenge:
      environment: {}
    hooks:
      changed: []
    deploy: {}
  • default mode for Linux certificate deployment directories.

    Default0750
  • default mode for Linux deployed certificate files.

    Default0640
  • default mode for Linux deployed private keys.

    Default0640
  • values for keys missing in deploy.pem.

    Default
    owner: root
    group: root
    directory_mode: '{{ lego_default_deploy_directory_mode }}'
    certificate_mode: '{{ lego_default_deploy_file_mode }}'
    private_key_mode: '{{ lego_default_deploy_private_key_mode }}'
  • values for keys missing in deploy.pfx.

    Default
    owner: root
    group: root
    directory_mode: '0700'
    mode: '0600'
  • values for keys missing in deploy.windows_store.

    Default
    store_location: LocalMachine
    store_name: My
  • additional Lego arguments passed to every certificate.

    Default[]