2016-01-12 00:20:42 +07:00
|
|
|
---
|
|
|
|
|
2019-04-23 14:28:00 +07:00
|
|
|
- name: SET_FACT | Bypass https://github.com/ansible/ansible/issues/19874
|
|
|
|
set_fact:
|
|
|
|
ansible_distribution_release: 'buster'
|
|
|
|
when: ansible_facts.distribution_major_version == "buster/sid"
|
|
|
|
|
2016-03-07 17:59:26 +07:00
|
|
|
- name: APT | Update cache
|
2017-07-27 17:21:10 +07:00
|
|
|
apt:
|
2021-09-01 16:21:12 +07:00
|
|
|
update_cache: true
|
2017-07-27 17:21:10 +07:00
|
|
|
cache_valid_time: 3600
|
2016-12-08 23:34:59 +07:00
|
|
|
changed_when: false
|
2016-02-10 00:36:48 +07:00
|
|
|
|
2016-01-12 00:20:42 +07:00
|
|
|
- name: APT | Install nginx and dependencies
|
2017-07-27 17:21:10 +07:00
|
|
|
apt:
|
|
|
|
pkg: "{{ nginx_apt_package }}"
|
|
|
|
default_release: "{{ ansible_distribution_release + '-backports' if nginx_backports else ansible_distribution_release }}"
|
2016-01-12 00:20:42 +07:00
|
|
|
|
2017-12-15 01:41:05 +07:00
|
|
|
- name: APT | Install nginx modules
|
|
|
|
apt:
|
2019-01-24 17:05:46 +07:00
|
|
|
pkg: "{{ nginx_module_packages }}"
|
2017-12-15 01:41:05 +07:00
|
|
|
state: present
|
|
|
|
|
2016-01-12 00:20:42 +07:00
|
|
|
- name: APT | Install python-passlib
|
2017-07-27 17:21:10 +07:00
|
|
|
apt:
|
2020-01-02 04:56:08 +07:00
|
|
|
pkg: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}-passlib"
|
2017-07-27 17:21:10 +07:00
|
|
|
state: present
|
2018-03-17 03:56:15 +07:00
|
|
|
|
|
|
|
- name: STAT | Check acme.sh is installed
|
|
|
|
stat:
|
|
|
|
path: "{{ nginx_acmesh_dir }}"
|
|
|
|
register: acme
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
2021-09-01 16:21:12 +07:00
|
|
|
- name: APT | Install git
|
|
|
|
apt:
|
|
|
|
pkg: git
|
2018-03-17 03:56:15 +07:00
|
|
|
|
2021-09-01 16:21:12 +07:00
|
|
|
- name: GIT | Get acme.sh
|
|
|
|
git:
|
|
|
|
repo: 'https://github.com/Neilpang/acme.sh.git'
|
|
|
|
dest: '{{ nginx_acmesh_git_dir }}'
|
|
|
|
update: false
|
|
|
|
version: master
|
2018-03-17 03:56:15 +07:00
|
|
|
|
2021-09-01 16:21:12 +07:00
|
|
|
- name: COMMAND | Install acme.sh
|
|
|
|
command: ./acme.sh --install --home "{{ nginx_acmesh_dir }}"
|
|
|
|
args:
|
|
|
|
chdir: "{{ nginx_acmesh_git_dir }}"
|
|
|
|
creates: "{{ nginx_acmesh_dir }}"
|
2018-03-17 03:56:15 +07:00
|
|
|
|
|
|
|
when: not acme.stat.exists
|