+feature added: install acme.sh
This commit is contained in:
parent
beba645030
commit
d57f3c45f0
3 changed files with 28 additions and 25 deletions
|
@ -1,15 +1,17 @@
|
|||
---
|
||||
- name: Git fetch acme.sh repository
|
||||
ansible.builtin.git:
|
||||
repo: "https://github.com/acmesh-official/acme.sh.git"
|
||||
dest: "{{ acme_user_home }}/acme.sh"
|
||||
|
||||
- name: Check acme.sh installation existence
|
||||
ansible.builtin.stat:
|
||||
path: "{{ acme_sh_home }}"
|
||||
register: acme_sh_folder_stats
|
||||
repo: "{{ acme_sh_git_repo }}"
|
||||
dest: "{{ acme_sh_git_folder }}"
|
||||
|
||||
- name: Install acme.sh
|
||||
ansible.builtin.debug:
|
||||
msg: "installing..."
|
||||
when: acme_sh_folder_stats.stat.isdir is defined and acme_sh_folder_stats.stat.isdir
|
||||
ansible.builtin.command:
|
||||
chdir: "{{ acme_sh_git_folder }}"
|
||||
cmd: |
|
||||
/bin/sh acme.sh
|
||||
--install
|
||||
--home {{ acme_sh_home | quote }}
|
||||
--cert-home {{ acme_sh_cert_home | quote }}
|
||||
--config-home {{ acme_sh_config_home | quote }}
|
||||
-m {{ acme_sh_email | quote }}
|
||||
creates: "{{ acme_sh_home }}"
|
||||
|
|
|
@ -10,18 +10,17 @@
|
|||
- name: Create acme user
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
name: "{{ acme_user }}"
|
||||
name: "{{ acme_sh_user }}"
|
||||
|
||||
- name: Add acme user to Docker group
|
||||
- name: Add acme user to groups
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
name: "{{ acme_user }}"
|
||||
groups: "{{ docker_group }}"
|
||||
name: "{{ acme_sh_user }}"
|
||||
groups: "{{ acme_sh_user_groups }}"
|
||||
append: true
|
||||
home: "{{ acme_user_home }}"
|
||||
when: add_to_docker_group == true
|
||||
when: acme_sh_user_groups|length > 0
|
||||
|
||||
- name: Install acme.sh
|
||||
become: true
|
||||
become_user: "{{ acme_user }}"
|
||||
become_user: "{{ acme_sh_user }}"
|
||||
ansible.builtin.import_tasks: "install_acmesh.yml"
|
Loading…
Add table
Add a link
Reference in a new issue