Changeset - 2dc24f376af8
[Not reviewed]
0 1 0
x - 17 months ago 2023-12-14 20:36:01
xbr@c3l.lu
fix: acme.sh installation now works
1 file changed with 22 insertions and 0 deletions:
0 comments (0 inline, 0 general)
web/tasks/install_acme_sh.yml
Show inline comments
 
@@ -18,12 +18,34 @@
 
  become_method: sudo
 
  register: download_acme
 
  when: acme_config.stat.exists == false
 
- name: Install socat (required for acme.sh)
 
  ansible.builtin.apt:
 
    name: socat
 
    state: present
 
  become: true
 
- name: Copy downloaded_acme.sh for installation (temporary file) # the script copies ./acme.sh
 
  ansible.builtin.copy:
 
    remote_src: true
 
    src: "/opt/downloaded_acme.sh"
 
    dest: "/opt/acme.sh"
 
    mode: '755'
 
    owner: root
 
    group: root
 
  become: true
 
  when: download_acme.changed and acme_config.stat.exists == false
 
- name: Install acme.sh
 
  ansible.builtin.command:
 
    cmd: "/bin/bash /opt/downloaded_acme.sh --install --nocron -m freifunk@c3l.lu"
 
    chdir: "/opt" # Required because of script copying ./acme.sh
 
  become: true
 
  become_method: sudo
 
  when: download_acme.changed and acme_config.stat.exists == false
 
- name: Delete temporary acme.sh file
 
  ansible.builtin.file:
 
    path: "/opt/acme.sh"
 
    state: absent
 
  become: true
 
  when: download_acme.changed and acme_config.stat.exists == false
 
- name: Update acme.sh if not newly installed
 
  ansible.builtin.command:
 
    cmd: "/bin/bash /root/.acme.sh/acme.sh --upgrade"
0 comments (0 inline, 0 general)