From 0f013053ca8be5c17f022a5f0df3ed9a889f171a Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Thu, 7 Nov 2024 21:27:42 +0100 Subject: [PATCH] remove haproxy --- haproxy/files/haproxy_config.j2 | 40 ------------------ haproxy/files/haproxy_rcscript.initd.j2 | 54 ------------------------- haproxy/init.ansible.yml | 2 - haproxy/map.yml | 1 - haproxy/pkg.ansible.yml | 34 ---------------- haproxy/service.ansible.yml | 7 ---- top.ansible.yml | 1 - 7 files changed, 139 deletions(-) delete mode 100644 haproxy/files/haproxy_config.j2 delete mode 100644 haproxy/files/haproxy_rcscript.initd.j2 delete mode 100644 haproxy/init.ansible.yml delete mode 100644 haproxy/map.yml delete mode 100644 haproxy/pkg.ansible.yml delete mode 100644 haproxy/service.ansible.yml diff --git a/haproxy/files/haproxy_config.j2 b/haproxy/files/haproxy_config.j2 deleted file mode 100644 index f590fd3..0000000 --- a/haproxy/files/haproxy_config.j2 +++ /dev/null @@ -1,40 +0,0 @@ -global - log 127.0.0.1 local2 - - maxconn 4000 - user haproxy - group haproxy - daemon - - stats socket /var/lib/haproxy/stats - -defaults - mode http - log global - timeout queue 1m - timeout connect 10s - timeout client 5m - timeout server 5m - maxconn 3000 - -frontend ssh - mode tcp - - bind {{ IPV4 }}:22 - - default_backend host-ssh - -frontend http - mode tcp - bind {{ IPV4 }}:80 - - default_backend host-http - -backend host-ssh - mode tcp - - server localhost 127.0.0.1 - -backend host-http - mode tcp - server localhost 127.0.0.1 diff --git a/haproxy/files/haproxy_rcscript.initd.j2 b/haproxy/files/haproxy_rcscript.initd.j2 deleted file mode 100644 index a654b79..0000000 --- a/haproxy/files/haproxy_rcscript.initd.j2 +++ /dev/null @@ -1,54 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/haproxy/files/haproxy.initd-r1,v 1.2 2011/12/04 10:32:32 swegener Exp $ - -extra_commands="checkconfig" -extra_started_commands="reload" -command=/usr/sbin/haproxy - -CONF=${HAPROXY_CONF:-/etc/haproxy/${SVCNAME}.cfg} -CONF_DIR=${HAPROXY_CONF_DIR:-{{ CONF_DIR }}} -PIDFILE=/var/run/${SVCNAME}.pid - -depend() { - need net - after firewall - use dns logger -} - -checkconfig() { - if [ ! -f "${CONF}" ] && [ ! -d "${CONF}" ]; then - eerror "${CONF} does not exist!" - return 1 - fi - - ebegin "Checking ${CONF}" - $command -q -c -f "${CONF}" - eend $? -} - -start() { - ebegin "Starting ${SVCNAME}" - start-stop-daemon --pidfile "${PIDFILE}" --exec $command \ - --start -- -D -p "${PIDFILE}" -f "${CONF}" -f "${CONF_DIR}" - eend $? -} - -stop() { - ebegin "Stopping ${SVCNAME}" - - if [ "${RC_CMD}" = "restart" ]; then - checkconfig || return 1 - fi - - start-stop-daemon --stop --pidfile "${PIDFILE}" - eend $? -} - -reload() { - ebegin "Reloading ${SVCNAME}" - checkconfig || { eerror "Reloading failed, please fix your ${CONF} first"; return 1; } - $command -D -p "${PIDFILE}" -f "${CONF}" -f "${CONF_DIR}" -sf $(cat "${PIDFILE}") - eend $? -} diff --git a/haproxy/init.ansible.yml b/haproxy/init.ansible.yml deleted file mode 100644 index 1a26d84..0000000 --- a/haproxy/init.ansible.yml +++ /dev/null @@ -1,2 +0,0 @@ -- import_playbook: pkg.ansible.yml -- import_playbook: service.ansible.yml diff --git a/haproxy/map.yml b/haproxy/map.yml deleted file mode 100644 index aca5e29..0000000 --- a/haproxy/map.yml +++ /dev/null @@ -1 +0,0 @@ -conf_dir: /etc/haproxy/conf.d diff --git a/haproxy/pkg.ansible.yml b/haproxy/pkg.ansible.yml deleted file mode 100644 index 569e8ba..0000000 --- a/haproxy/pkg.ansible.yml +++ /dev/null @@ -1,34 +0,0 @@ -- hosts: localhost - vars_files: - - map.yml - tasks: - - name: Install haproxy pkg - package: - state: present - name: - - haproxy - - name: Setup haproxy conf.d directory - file: - state: directory - path: /etc/haproxy/conf.d - owner: root - group: root - mode: '0755' - - name: Populate haproxy config - template: - src: files/haproxy_config.j2 - dest: /etc/haproxy/haproxy.cfg - owner: root - group: root - mode: '0644' - vars: - IPV4: "{{ ansible_default_ipv4.address }}" - - name: Populate haproxy rc-script - template: - src: files/haproxy_rcscript.initd.j2 - dest: /etc/init.d/haproxy - owner: root - group: root - mode: '0755' - vars: - CONF_DIR: "{{ conf_dir }}" diff --git a/haproxy/service.ansible.yml b/haproxy/service.ansible.yml deleted file mode 100644 index ba1329b..0000000 --- a/haproxy/service.ansible.yml +++ /dev/null @@ -1,7 +0,0 @@ -- hosts: localhost - tasks: - - name: Enable haproxy service - service: - name: haproxy - state: started - enabled: true diff --git a/top.ansible.yml b/top.ansible.yml index 3ec8f91..4c92ea4 100644 --- a/top.ansible.yml +++ b/top.ansible.yml @@ -3,4 +3,3 @@ - import_playbook: network/init.ansible.yml - import_playbook: apps/init.ansible.yml - import_playbook: openssh/init.ansible.yml -- import_playbook: haproxy/init.ansible.yml