Some code refactoring on install process
parent
297dc1f669
commit
8de557346e
|
@ -25,29 +25,3 @@
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
pkg: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}-passlib"
|
pkg: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}-passlib"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: STAT | Check acme.sh is installed
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ nginx_acmesh_dir }}"
|
|
||||||
register: acme
|
|
||||||
|
|
||||||
- block:
|
|
||||||
|
|
||||||
- name: APT | Install git
|
|
||||||
ansible.builtin.apt:
|
|
||||||
pkg: git
|
|
||||||
|
|
||||||
- name: GIT | Get acme.sh
|
|
||||||
ansible.builtin.git:
|
|
||||||
repo: 'https://github.com/Neilpang/acme.sh.git'
|
|
||||||
dest: '{{ nginx_acmesh_git_dir }}'
|
|
||||||
update: false
|
|
||||||
version: master
|
|
||||||
|
|
||||||
- name: COMMAND | Install acme.sh
|
|
||||||
ansible.builtin.command: ./acme.sh --install --home "{{ nginx_acmesh_dir }}"
|
|
||||||
args:
|
|
||||||
chdir: "{{ nginx_acmesh_git_dir }}"
|
|
||||||
creates: "{{ nginx_acmesh_dir }}"
|
|
||||||
|
|
||||||
when: not acme.stat.exists
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: STAT | Check acme.sh is installed
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ nginx_acmesh_dir }}"
|
||||||
|
register: acme
|
||||||
|
|
||||||
|
- block:
|
||||||
|
|
||||||
|
- name: APT | Install git
|
||||||
|
ansible.builtin.apt:
|
||||||
|
pkg: git
|
||||||
|
|
||||||
|
- name: GIT | Get acme.sh
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: 'https://github.com/Neilpang/acme.sh.git'
|
||||||
|
dest: '{{ nginx_acmesh_git_dir }}'
|
||||||
|
update: false
|
||||||
|
version: master
|
||||||
|
|
||||||
|
- name: COMMAND | Install acme.sh
|
||||||
|
ansible.builtin.command: ./acme.sh --install --home "{{ nginx_acmesh_dir }}"
|
||||||
|
args:
|
||||||
|
chdir: "{{ nginx_acmesh_git_dir }}"
|
||||||
|
creates: "{{ nginx_acmesh_dir }}"
|
||||||
|
|
||||||
|
when: not acme.stat.exists
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: INCLUDE_TASKS | Install
|
||||||
|
ansible.builtin.include_tasks: "{{ ansible_distribution }}.yml"
|
||||||
|
|
||||||
|
- name: IMPORT_TASKS | acme
|
||||||
|
ansible.builtin.include_tasks: "acme.yml"
|
|
@ -5,7 +5,7 @@
|
||||||
tags: ['nginx::site', 'nginx::ssl']
|
tags: ['nginx::site', 'nginx::ssl']
|
||||||
|
|
||||||
- name: INCLUDE_TASKS | Install
|
- name: INCLUDE_TASKS | Install
|
||||||
ansible.builtin.include_tasks: "install_{{ ansible_distribution }}.yml"
|
ansible.builtin.import_tasks: "install/main.yml"
|
||||||
tags: ['nginx::site', 'nginx::ssl']
|
tags: ['nginx::site', 'nginx::ssl']
|
||||||
|
|
||||||
- name: IMPORT_TASKS| Prepare
|
- name: IMPORT_TASKS| Prepare
|
||||||
|
|
Loading…
Reference in New Issue