60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
---
|
|
|
|
- name: PKGNG | Install nginx and related tools
|
|
community.general.pkgng:
|
|
name: "{{ item }}"
|
|
state: present
|
|
loop:
|
|
- acme.sh
|
|
- "{{ nginx_pkgng_package }}"
|
|
- py27-passlib
|
|
- curl
|
|
|
|
#
|
|
# Bypass https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224166#c1
|
|
#
|
|
- name: Bypass https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224166#c1
|
|
when: true
|
|
block:
|
|
|
|
- name: COMMAND | Create /usr/local/etc/fdfs/http.conf
|
|
ansible.builtin.command: touch /usr/local/etc/fdfs/http.conf
|
|
args:
|
|
creates: /usr/local/etc/fdfs/http.conf
|
|
notify: Restart nginx
|
|
|
|
- name: LINEINFILE | Tune fdfs
|
|
ansible.builtin.lineinfile:
|
|
regexp: ^load_fdfs_parameters_from_tracker
|
|
line: load_fdfs_parameters_from_tracker=false
|
|
path: /usr/local/etc/fdfs/mod_fastdfs.conf
|
|
notify: Restart nginx
|
|
|
|
- name: META | Flush handlers (Restart nginx when fdfs is tuned)
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: FILE | Create configuration dir (like Debian)
|
|
ansible.builtin.file:
|
|
path: "{{ nginx_etc_dir }}/{{ item }}"
|
|
state: directory
|
|
mode: 0755
|
|
owner: root
|
|
group: root
|
|
loop:
|
|
- conf.d
|
|
- sites-available
|
|
- sites-enabled
|
|
|
|
- name: FILE | Create log directory
|
|
ansible.builtin.file:
|
|
path: "{{ nginx_log_dir }}"
|
|
owner: "{{ nginx_user }}"
|
|
group: wheel
|
|
mode: 0755
|
|
state: directory
|
|
|
|
- name: SERVICE | Enable nginx
|
|
ansible.builtin.service:
|
|
name: nginx
|
|
enabled: true
|