Jan Dittberner
5daa87ca90
This commit adds a role to ensure local preconditions (i.e. mkcert) and a Vagrantfile to test the ansible playbook in a local virtual machine.
28 lines
1 KiB
YAML
28 lines
1 KiB
YAML
---
|
|
- name: Create .local/bin for ansible user
|
|
ansible.builtin.file:
|
|
path: "/home/{{ ansible_user | default(ansible_env.USER) }}/.local/bin"
|
|
state: directory
|
|
owner: "{{ ansible_user | default(ansible_env.USER) }}"
|
|
group: "{{ ansible_user | default(ansible_env.USER) }}"
|
|
mode: "0750"
|
|
|
|
- name: Prepare mkcert
|
|
block:
|
|
|
|
- name: Download mkcert binary
|
|
ansible.builtin.get_url:
|
|
url: "https://github.com/FiloSottile/mkcert/releases/download/{{ mkcert_version }}/mkcert-{{ mkcert_version }}-linux-amd64"
|
|
dest: "/home/{{ ansible_user | default(ansible_env.USER) }}/.local/bin/mkcert"
|
|
checksum: "sha256:{{ mkcert_checksum }}"
|
|
owner: "{{ ansible_user | default(ansible_env.USER) }}"
|
|
group: "{{ ansible_user | default(ansible_env.USER) }}"
|
|
mode: "0750"
|
|
|
|
- name: Install mkcert CA
|
|
ansible.builtin.command:
|
|
cmd: "/home/{{ ansible_user | default(ansible_env.USER) }}/.local/bin/mkcert -install"
|
|
changed_when: false
|
|
|
|
when: use_mkcert
|
|
become: false
|