remove haproxy
This commit is contained in:
parent
6dac696632
commit
f76a09344c
8 changed files with 1 additions and 140 deletions
|
@ -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
|
|
@ -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 $?
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
- import_playbook: pkg.ansible.yml
|
||||
- import_playbook: service.ansible.yml
|
|
@ -1 +0,0 @@
|
|||
conf_dir: /etc/haproxy/conf.d
|
|
@ -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 }}"
|
|
@ -1,7 +0,0 @@
|
|||
- hosts: localhost
|
||||
tasks:
|
||||
- name: Enable haproxy service
|
||||
service:
|
||||
name: haproxy
|
||||
state: started
|
||||
enabled: true
|
|
@ -20,7 +20,7 @@ Include /etc/ssh/sshd_config.d/*.conf
|
|||
#
|
||||
Port 22
|
||||
#AddressFamily any
|
||||
ListenAddress 127.0.0.1
|
||||
#ListenAddress 0.0.0.0
|
||||
#ListenAddress ::
|
||||
|
||||
#HostKey /etc/ssh/ssh_host_rsa_key
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue