This repository has been archived on 2022-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-nginx-vts-role/tasks/main.yml

47 lines
1.2 KiB
YAML
Raw Normal View History

2022-04-01 14:34:33 +02:00
---
# tasks file for Ansible-Nginx-Vts-Role
2022-04-01 15:00:06 +02:00
- name: Download NGINX
get_url:
2022-04-01 16:28:22 +02:00
url: "https://nginx.org/download/nginx-{{ nginx_source_version }}.tar.gz"
2022-04-01 15:00:06 +02:00
dest: "/tmp/{{ nginx_source_version }}.tar.gz"
mode: 0600
register: nginx_source
- name: Unpack NGINX
unarchive:
copy: false
dest: /tmp/
2022-04-01 16:28:22 +02:00
src: "{{ nginx_source.dest }}"
2022-04-01 15:00:06 +02:00
mode: 0755
- name: Get vts
ansible.builtin.git:
repo: "{{ vts_repot_url }}"
dest: "/tmp/vts"
2022-04-01 16:28:22 +02:00
- name: Get build flags
ansible.builtin.command: "nginx -V"
register: command_result
- name: Clean flags
ansible.builtin.set_fact:
build_flags: "{{ command_result.stderr_lines | last | replace('configure arguments: ' ,'')}}"
- name: Configure build
args:
chdir: "/tmp/nginx-{{ nginx_source_version }}"
ansible.builtin.command: "./configure --add-dynamic-module=../vts {{ build_flags }}"
- name: Build module
community.general.make:
chdir: "/tmp/nginx-{{ nginx_source_version }}"
target: modules
- name: Copy VTS module
ansible.builtin.copy:
remote_src: True
src: "/tmp/nginx-{{ nginx_source_version }}/objs/ngx_http_vhost_traffic_status_module.so"
dest: "{{ nginx_module_install_path }}/ngx_http_vhost_traffic_status_module.so"
mode: "0644"