48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
---
|
|
|
|
- name: SHELL | Get Nginx version
|
|
ansible.builtin.shell: nginx -v 2>&1 | sed -r 's#.*/##;' | cut -d ' ' -f 1
|
|
args:
|
|
executable: /bin/sh
|
|
register: nginx_version
|
|
changed_when: false
|
|
check_mode: false
|
|
tags:
|
|
- skip_ansible_lint
|
|
|
|
- name: SHELL | Get module list
|
|
ansible.builtin.shell: |
|
|
nginx -V 2>&1 |
|
|
tr -- - '\n' |
|
|
grep -A 1 with |
|
|
grep _module |
|
|
sed -r 's/_module//g; s/\s+//g' |
|
|
sort
|
|
args:
|
|
executable: /bin/sh
|
|
register: shell_modules
|
|
changed_when: false
|
|
check_mode: false
|
|
tags:
|
|
- skip_ansible_lint
|
|
|
|
- name: SET_FACT | Save modules
|
|
ansible.builtin.set_fact:
|
|
nginx_modules: "{{ shell_modules.stdout_lines }}"
|
|
|
|
- name: FILE | Create folders
|
|
ansible.builtin.file:
|
|
dest: "{{ item.dir }}"
|
|
owner: "{{ item.owner }}"
|
|
mode: "{{ item.mode }}"
|
|
state: directory
|
|
loop: "{{ nginx_dirs }}"
|
|
|
|
- name: FILE | Create ansible facts dir
|
|
ansible.builtin.file:
|
|
path: /etc/ansible/facts.d
|
|
state: directory
|
|
mode: 0755
|
|
owner: root
|
|
group: root
|