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
2022-04-01 16:28:22 +02:00

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"