caddy: Lint and compatcheck
This commit is contained in:
9
roles/caddy/meta/argument_specs.yaml
Normal file
9
roles/caddy/meta/argument_specs.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
argument_specs:
|
||||||
|
main:
|
||||||
|
short_description: Installs caddy
|
||||||
|
options:
|
||||||
|
caddy_admin_email:
|
||||||
|
description: Email address used for ssl certs
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
---
|
---
|
||||||
|
- name: Ensure host distribution is supported
|
||||||
|
ansible.builtin.import_role:
|
||||||
|
name: compatcheck
|
||||||
|
vars:
|
||||||
|
compatcheck_supported_distributions:
|
||||||
|
- name: debian
|
||||||
|
version_min: 11
|
||||||
|
- name: ubuntu
|
||||||
|
version_min: 20
|
||||||
|
|
||||||
- name: Add caddy apt repository
|
- name: Add caddy apt repository
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.include_role:
|
||||||
name: apt_repository
|
name: apt_repository
|
||||||
vars:
|
vars:
|
||||||
repo_name: caddy-stable
|
repo_name: caddy-stable
|
||||||
@@ -10,6 +19,9 @@
|
|||||||
repo_suite: any-version
|
repo_suite: any-version
|
||||||
repo_components:
|
repo_components:
|
||||||
- main
|
- main
|
||||||
|
when: >
|
||||||
|
(ansible_distribution == 'Debian' and ansible_distribution_major_version | int == 11) or
|
||||||
|
(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version | int < 24)
|
||||||
|
|
||||||
- name: Install caddy
|
- name: Install caddy
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
@@ -31,7 +43,7 @@
|
|||||||
marker: "# {mark} ANSIBLE MANAGED BLOCK general"
|
marker: "# {mark} ANSIBLE MANAGED BLOCK general"
|
||||||
block: |
|
block: |
|
||||||
{
|
{
|
||||||
email {{ admin_email }}
|
email {{ caddy_admin_email }}
|
||||||
}
|
}
|
||||||
validate: 'caddy validate --config %s --adapter caddyfile'
|
validate: 'caddy validate --config %s --adapter caddyfile'
|
||||||
backup: true
|
backup: true
|
||||||
|
|||||||
Reference in New Issue
Block a user