generated from sebclem/ansible-role-template
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
---
|
|
# tasks file for Ansible-Nginx-Vts-Role
|
|
|
|
- name: Download NGINX
|
|
get_url:
|
|
url: "https://nginx.org/download/nginx-{{ nginx_source_version }}.tar.gz"
|
|
dest: "/tmp/{{ nginx_source_version }}.tar.gz"
|
|
mode: 0600
|
|
register: nginx_source
|
|
|
|
- name: Unpack NGINX
|
|
unarchive:
|
|
copy: false
|
|
dest: /tmp/
|
|
src: "{{ nginx_source.dest }}"
|
|
mode: 0755
|
|
|
|
- name: Get vts
|
|
ansible.builtin.git:
|
|
repo: "{{ vts_repot_url }}"
|
|
dest: "/tmp/vts"
|
|
|
|
- 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"
|