mirror of https://github.com/Aidaho12/haproxy-wi
v8.0: Comment out duplicate HAProxy installation task
Disabled a redundant HAProxy installation section in the Ansible playbook by commenting it out. Also removed the unnecessary `distro` library import and standardized the Python interpreter path in the service installation module for cleanup and consistency.pull/399/head
parent
a7a8b4b10d
commit
a1ed81b0a2
|
@ -3,7 +3,6 @@ import json
|
||||||
from typing import Union
|
from typing import Union
|
||||||
from packaging import version
|
from packaging import version
|
||||||
|
|
||||||
import distro
|
|
||||||
import ansible
|
import ansible
|
||||||
import ansible_runner
|
import ansible_runner
|
||||||
|
|
||||||
|
@ -212,7 +211,6 @@ def run_ansible(inv: dict, server_ips: list, ansible_role: str) -> dict:
|
||||||
proxy = sql.get_setting('proxy')
|
proxy = sql.get_setting('proxy')
|
||||||
proxy_serv = ''
|
proxy_serv = ''
|
||||||
tags = ''
|
tags = ''
|
||||||
python_int = '/usr/bin/python3' if distro.id() == 'ubuntu' else '/usr/bin/python3.11'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
agent_pid = server_mod.start_ssh_agent()
|
agent_pid = server_mod.start_ssh_agent()
|
||||||
|
@ -263,7 +261,7 @@ def run_ansible(inv: dict, server_ips: list, ansible_role: str) -> dict:
|
||||||
'AWX_DISPLAY': False,
|
'AWX_DISPLAY': False,
|
||||||
'SSH_AUTH_PID': agent_pid['pid'],
|
'SSH_AUTH_PID': agent_pid['pid'],
|
||||||
'SSH_AUTH_SOCK': agent_pid['socket'],
|
'SSH_AUTH_SOCK': agent_pid['socket'],
|
||||||
'ANSIBLE_PYTHON_INTERPRETER': python_int
|
'ANSIBLE_PYTHON_INTERPRETER': '/usr/bin/python3'
|
||||||
}
|
}
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'private_data_dir': '/var/www/haproxy-wi/app/scripts/ansible/',
|
'private_data_dir': '/var/www/haproxy-wi/app/scripts/ansible/',
|
||||||
|
|
|
@ -37,23 +37,23 @@
|
||||||
http_proxy: "{{PROXY}}"
|
http_proxy: "{{PROXY}}"
|
||||||
https_proxy: "{{PROXY}}"
|
https_proxy: "{{PROXY}}"
|
||||||
|
|
||||||
- name: Try to install another HAProxy {{HAPVER}} on {{distr_short_name}}{{ansible_facts['distribution_major_version']}}
|
#- name: Try to install another HAProxy {{HAPVER}} on {{distr_short_name}}{{ansible_facts['distribution_major_version']}}
|
||||||
yum:
|
# yum:
|
||||||
name:
|
# name:
|
||||||
- http://repo1.roxy-wi.org/haproxy/haproxy-{{HAPVER}}.{{distr_short_name}}{{ansible_facts['distribution_major_version']}}.x86_64.rpm
|
# - http://repo1.roxy-wi.org/haproxy/haproxy-{{HAPVER}}.{{distr_short_name}}{{ansible_facts['distribution_major_version']}}.x86_64.rpm
|
||||||
- socat
|
# - socat
|
||||||
- rsyslog
|
# - rsyslog
|
||||||
- bind-utils
|
# - bind-utils
|
||||||
state: present
|
# state: present
|
||||||
when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS') and ("'timed out' in install_result.stderr")
|
# when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS') and ("'timed out' in install_result.stderr")
|
||||||
ignore_errors: yes
|
# ignore_errors: yes
|
||||||
register: install_result1
|
# register: install_result1
|
||||||
retries: 3
|
# retries: 3
|
||||||
until: install_result1.rc == 0
|
# until: install_result1.rc == 0
|
||||||
delay: 3
|
# delay: 3
|
||||||
environment:
|
# environment:
|
||||||
http_proxy: "{{PROXY}}"
|
# http_proxy: "{{PROXY}}"
|
||||||
https_proxy: "{{PROXY}}"
|
# https_proxy: "{{PROXY}}"
|
||||||
|
|
||||||
|
|
||||||
- name: set_fact from wi
|
- name: set_fact from wi
|
||||||
|
|
Loading…
Reference in New Issue