mirror of https://github.com/Aidaho12/haproxy-wi
parent
204fcd855a
commit
f79a1afb1f
|
@ -159,6 +159,13 @@ def install_service(server_ip: str, service: str, docker: str, **kwargs) -> None
|
||||||
|
|
||||||
syn_flood_protect = '1' if form.getvalue('syn_flood') == "1" else ''
|
syn_flood_protect = '1' if form.getvalue('syn_flood') == "1" else ''
|
||||||
|
|
||||||
|
if service == 'apache':
|
||||||
|
correct_service_name = service_common.get_correct_apache_service_name(server_ip=server_ip)
|
||||||
|
if service_dir == '/etc/httpd' and correct_service_name == 'apache2':
|
||||||
|
service_dir = '/etc/apache2'
|
||||||
|
elif service_dir == '/etc/apache2' and correct_service_name == 'httpd':
|
||||||
|
service_dir = '/etc/httpd'
|
||||||
|
|
||||||
commands = [
|
commands = [
|
||||||
f"chmod +x {script} && ./{script} PROXY={proxy_serv} STATS_USER={stats_user} STATS_PASS='{stats_password}' "
|
f"chmod +x {script} && ./{script} PROXY={proxy_serv} STATS_USER={stats_user} STATS_PASS='{stats_password}' "
|
||||||
f"SSH_PORT={ssh_settings['port']} CONFIG_PATH={config_path} CONT_NAME={container_name} STAT_PORT={stats_port} "
|
f"SSH_PORT={ssh_settings['port']} CONFIG_PATH={config_path} CONT_NAME={container_name} STAT_PORT={stats_port} "
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
become_method: sudo
|
become_method: sudo
|
||||||
tasks:
|
tasks:
|
||||||
- name: Add syn_flood tasks
|
- name: Add syn_flood tasks
|
||||||
include: haproxy/tasks/syn_flood.yml
|
include_tasks: haproxy/tasks/syn_flood.yml
|
||||||
when: (SYN_FLOOD is defined) and (SYN_FLOOD|length > 0)
|
when: (SYN_FLOOD is defined) and (SYN_FLOOD|length > 0)
|
||||||
roles:
|
roles:
|
||||||
- role: apache
|
- role: apache
|
||||||
|
@ -48,3 +48,22 @@
|
||||||
https_proxy: "{{PROXY}}"
|
https_proxy: "{{PROXY}}"
|
||||||
tags:
|
tags:
|
||||||
- system
|
- system
|
||||||
|
|
||||||
|
- name: "Set {{ ansible_user }} owner to {{ service_dir }}"
|
||||||
|
hosts: "{{ variable_host }}"
|
||||||
|
become: yes
|
||||||
|
gather_facts: no
|
||||||
|
tasks:
|
||||||
|
- name: Set SSH port
|
||||||
|
set_fact:
|
||||||
|
ansible_port: "{{SSH_PORT}}"
|
||||||
|
- name: "Set {{ ansible_user }} owner to {{ service_dir }}"
|
||||||
|
file:
|
||||||
|
path: "{{ service_dir }}"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ ansible_user }}"
|
||||||
|
state: directory
|
||||||
|
recurse: yes
|
||||||
|
tags:
|
||||||
|
- system
|
||||||
|
- docker
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
become_method: sudo
|
become_method: sudo
|
||||||
tasks:
|
tasks:
|
||||||
- name: Add syn_flood tasks
|
- name: Add syn_flood tasks
|
||||||
include: haproxy/tasks/syn_flood.yml
|
include_tasks: haproxy/tasks/syn_flood.yml
|
||||||
when: (SYN_FLOOD is defined) and (SYN_FLOOD|length > 0)
|
when: (SYN_FLOOD is defined) and (SYN_FLOOD|length > 0)
|
||||||
- name: Install nginx for Centos Stream 9
|
- name: Install nginx for Centos Stream 9
|
||||||
package:
|
package:
|
||||||
|
@ -57,10 +57,14 @@
|
||||||
tags:
|
tags:
|
||||||
- system
|
- system
|
||||||
|
|
||||||
- name: Set correct owner
|
- name: "Set {{ ansible_user }} owner to {{ service_dir }}"
|
||||||
hosts: "{{ variable_host }}"
|
hosts: "{{ variable_host }}"
|
||||||
become: yes
|
become: yes
|
||||||
tasks:
|
tasks:
|
||||||
- name: Set
|
- name: Set
|
||||||
shell: "chown {{ ansible_user }}:{{ ansible_user }} -R {{ service_dir }}"
|
file:
|
||||||
|
path: "{{ service_dir }}"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ ansible_user }}"
|
||||||
|
state: directory
|
||||||
|
recurse: yes
|
||||||
|
|
Loading…
Reference in New Issue