generated from sebclem/ansible-role-template
First version
This commit is contained in:
parent
0ad07fa232
commit
3d3c16fe9d
3
ansible.cfg
Normal file
3
ansible.cfg
Normal file
@ -0,0 +1,3 @@
|
||||
[defaults]
|
||||
roles_path = ../
|
||||
stdout_callback = yaml
|
@ -4,3 +4,5 @@
|
||||
nginx_source_version: 1.21.6
|
||||
|
||||
vts_repot_url: https://github.com/vozlt/nginx-module-vts.git
|
||||
|
||||
nginx_module_install_path: "/usr/lib/nginx/modules"
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
- name: Download NGINX
|
||||
get_url:
|
||||
url: "https://nginx.org/download/{{ nginx_source_version }}.tar.gz"
|
||||
url: "https://nginx.org/download/nginx-{{ nginx_source_version }}.tar.gz"
|
||||
dest: "/tmp/{{ nginx_source_version }}.tar.gz"
|
||||
mode: 0600
|
||||
register: nginx_source
|
||||
@ -12,10 +12,35 @@
|
||||
unarchive:
|
||||
copy: false
|
||||
dest: /tmp/
|
||||
src: "{{ nginx_source_version.dest }}"
|
||||
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"
|
||||
|
@ -1,2 +1,2 @@
|
||||
localhost
|
||||
nginx.home
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
- hosts: nginx.home
|
||||
remote_user: root
|
||||
roles:
|
||||
- Ansible-Nginx-Vts-Role
|
||||
- ansible-nginx-vts-role
|
||||
|
Reference in New Issue
Block a user