Initial Lab Setup
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Ensure old Cloudsmith repository artifact is removed
|
||||
ansible.builtin.file:
|
||||
path: /etc/apt/sources.list.d/caddy-stable.list
|
||||
state: absent
|
||||
become: yes
|
||||
|
||||
- name: Install Caddy server package from official Debian repositories
|
||||
ansible.builtin.apt:
|
||||
name: caddy
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: yes
|
||||
|
||||
- name: Deploy Caddyfile configuration from template
|
||||
ansible.builtin.template:
|
||||
src: Caddyfile.j2
|
||||
dest: /etc/caddy/Caddyfile
|
||||
owner: caddy
|
||||
group: caddy
|
||||
mode: '0644'
|
||||
become: yes
|
||||
notify: Restart Caddy
|
||||
|
||||
- name: Ensure Caddy service is enabled and running
|
||||
ansible.builtin.systemd:
|
||||
name: caddy
|
||||
state: started
|
||||
enabled: yes
|
||||
become: yes
|
||||
Reference in New Issue
Block a user