---
- name: Clone Certbot into configured directory.
  ansible.builtin.git:
    repo: "{{ certbot_repo }}"
    dest: "{{ certbot_dir }}"
    version: "{{ certbot_version }}"
    update: "{{ certbot_keep_updated }}"
    force: true

- name: Set Certbot script variable.
  ansible.builtin.set_fact:
    certbot_script: "{{ certbot_dir }}/certbot-auto"

- name: Ensure certbot-auto is executable.
  ansible.builtin.file:
    path: "{{ certbot_script }}"
    mode: "0755"
