Uppdated service, defaults, etc
This commit is contained in:
parent
423f3ae8f2
commit
7dbfd54a70
6 changed files with 24 additions and 14 deletions
|
@ -1,5 +1,6 @@
|
||||||
{%- from slspath + '/map.jinja' import fabio with context -%}
|
{%- from slspath + '/map.jinja' import fabio with context -%}
|
||||||
|
|
||||||
|
{#
|
||||||
fabio-config:
|
fabio-config:
|
||||||
file.serialize:
|
file.serialize:
|
||||||
- name: /etc/fabio/config.json
|
- name: /etc/fabio/config.json
|
||||||
|
@ -41,3 +42,4 @@ fabio-script-config:
|
||||||
- formatter: json
|
- formatter: json
|
||||||
- dataset:
|
- dataset:
|
||||||
services: {{ fabio.register }}
|
services: {{ fabio.register }}
|
||||||
|
#}
|
||||||
|
|
|
@ -5,10 +5,11 @@ fabio:
|
||||||
|
|
||||||
service: false
|
service: false
|
||||||
|
|
||||||
user: root
|
user: fabio
|
||||||
group: root
|
group: fabio
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
consul_address: localhost:8500
|
||||||
server: false
|
server: false
|
||||||
bind_addr: 0.0.0.0
|
bind_addr: 0.0.0.0
|
||||||
data_dir: /var/fabio
|
data_dir: /var/fabio
|
||||||
|
|
|
@ -5,11 +5,16 @@ After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=-/etc/{% if grains['os_family'] == 'Debian' %}default{% else %}sysconfig{% endif %}/fabio
|
EnvironmentFile=-/etc/{% if grains['os_family'] == 'Debian' %}default{% else %}sysconfig{% endif %}/fabio
|
||||||
ExecStart=/usr/local/bin/fabio agent -config-dir=/etc/fabio.d
|
ExecStart=/usr/local/bin/fabio -registry.consul.addr consul.service.dc1.consul:8500
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
KillSignal=TERM
|
|
||||||
User={{ user }}
|
User={{ user }}
|
||||||
Group={{ group }}
|
Group={{ group }}
|
||||||
|
Restart=on-failure
|
||||||
|
CapabilityBoundingSet=CAP_SYSLOG CAP_NET_BIND_SERVICE
|
||||||
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
|
SecureBits=keep-caps
|
||||||
|
NoNewPrivileges=yes
|
||||||
|
KillSignal=TERM
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- {{ slspath }}.install
|
- {{ slspath }}.install
|
||||||
- {{ slspath }}.config
|
{# - {{ slspath }}.config #}
|
||||||
- {{ slspath }}.service
|
- {{ slspath }}.service
|
||||||
|
|
|
@ -5,8 +5,6 @@ fabio-bin-dir:
|
||||||
- name: /usr/local/bin
|
- name: /usr/local/bin
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
|
||||||
{#
|
|
||||||
# Create fabio user
|
# Create fabio user
|
||||||
fabio-group:
|
fabio-group:
|
||||||
group.present:
|
group.present:
|
||||||
|
@ -22,7 +20,6 @@ fabio-user:
|
||||||
- system: True
|
- system: True
|
||||||
- require:
|
- require:
|
||||||
- group: fabio-group
|
- group: fabio-group
|
||||||
#}
|
|
||||||
|
|
||||||
# Create directories
|
# Create directories
|
||||||
fabio-config-dir:
|
fabio-config-dir:
|
||||||
|
@ -32,7 +29,6 @@ fabio-config-dir:
|
||||||
- group: {{ fabio.group }}
|
- group: {{ fabio.group }}
|
||||||
- mode: 0750
|
- mode: 0750
|
||||||
|
|
||||||
{#
|
|
||||||
fabio-data-dir:
|
fabio-data-dir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: {{ fabio.config.data_dir }}
|
- name: {{ fabio.config.data_dir }}
|
||||||
|
@ -40,7 +36,6 @@ fabio-data-dir:
|
||||||
- user: {{ fabio.user }}
|
- user: {{ fabio.user }}
|
||||||
- group: {{ fabio.group }}
|
- group: {{ fabio.group }}
|
||||||
- mode: 0750
|
- mode: 0750
|
||||||
#}
|
|
||||||
|
|
||||||
# Install agent
|
# Install agent
|
||||||
fabio-download:
|
fabio-download:
|
||||||
|
@ -48,6 +43,7 @@ fabio-download:
|
||||||
- name: /tmp/fabio-{{ fabio.version }}
|
- name: /tmp/fabio-{{ fabio.version }}
|
||||||
- source: https://{{ fabio.download_host }}/fabiolb/fabio/releases/download/v{{ fabio.version }}/fabio-{{ fabio.version }}-go{{ fabio.goversion }}-linux_{{ fabio.arch }}
|
- source: https://{{ fabio.download_host }}/fabiolb/fabio/releases/download/v{{ fabio.version }}/fabio-{{ fabio.version }}-go{{ fabio.goversion }}-linux_{{ fabio.arch }}
|
||||||
- source_hash: https://github.com/fabiolb/fabio/releases/download/v{{ fabio.version }}/fabio-{{ fabio.version }}-go{{ fabio.goversion }}.sha256
|
- source_hash: https://github.com/fabiolb/fabio/releases/download/v{{ fabio.version }}/fabio-{{ fabio.version }}-go{{ fabio.goversion }}.sha256
|
||||||
|
- mode: 0755
|
||||||
- unless: test -f /usr/local/bin/fabio-{{ fabio.version }}
|
- unless: test -f /usr/local/bin/fabio-{{ fabio.version }}
|
||||||
|
|
||||||
fabio-install:
|
fabio-install:
|
||||||
|
@ -58,7 +54,7 @@ fabio-install:
|
||||||
- file: /usr/local/bin
|
- file: /usr/local/bin
|
||||||
- watch:
|
- watch:
|
||||||
- file: fabio-download
|
- file: fabio-download
|
||||||
|
|
||||||
fabio-clean:
|
fabio-clean:
|
||||||
file.absent:
|
file.absent:
|
||||||
- name: /tmp/fabio-{{ fabio.version }}
|
- name: /tmp/fabio-{{ fabio.version }}
|
||||||
|
@ -71,3 +67,9 @@ fabio-link:
|
||||||
- name: /usr/local/bin/fabio
|
- name: /usr/local/bin/fabio
|
||||||
- watch:
|
- watch:
|
||||||
- file: fabio-install
|
- file: fabio-install
|
||||||
|
|
||||||
|
fabio-setcap:
|
||||||
|
cmd.run:
|
||||||
|
- name: "setcap cap_net_bind_service=+ep /usr/local/bin/fabio-{{ fabio.version }}"
|
||||||
|
- onchanges:
|
||||||
|
- file: fabio-install
|
||||||
|
|
|
@ -12,9 +12,8 @@ fabio-init-env:
|
||||||
- group: root
|
- group: root
|
||||||
- mode: 0644
|
- mode: 0644
|
||||||
- contents:
|
- contents:
|
||||||
- fabio_USER={{ fabio.user }}
|
- FABIO_USER={{ fabio.user }}
|
||||||
- fabio_GROUP={{ fabio.group }}
|
- FABIO_GROUP={{ fabio.group }}
|
||||||
- fabio_UI_BETA={{ fabio.ui_beta }}
|
|
||||||
- GOMAXPROCS=2
|
- GOMAXPROCS=2
|
||||||
- PATH=/usr/local/bin:/usr/bin:/bin
|
- PATH=/usr/local/bin:/usr/bin:/bin
|
||||||
|
|
||||||
|
@ -27,6 +26,7 @@ fabio-init-file:
|
||||||
- context:
|
- context:
|
||||||
user: {{ fabio.user }}
|
user: {{ fabio.user }}
|
||||||
group: {{ fabio.group }}
|
group: {{ fabio.group }}
|
||||||
|
consul_address: {{ fabio.config.consul_address }}
|
||||||
- mode: 0644
|
- mode: 0644
|
||||||
{%- elif salt['test.provider']('service') == 'upstart' %}
|
{%- elif salt['test.provider']('service') == 'upstart' %}
|
||||||
- source: salt://{{ slspath }}/files/fabio.upstart
|
- source: salt://{{ slspath }}/files/fabio.upstart
|
||||||
|
|
Loading…
Reference in a new issue