Bootstrap cleanup (#4)

* README cleanup

* template migration

* convert percona to new bastillefile format

* convert gitlab to bastillefile format

* convert php to bastillefile format

---------

Co-authored-by: Barry McCormick <bmccormick@debianbeast.maildragon.com>
This commit is contained in:
Barry McCormick
2023-10-08 10:48:01 -07:00
committed by GitHub
parent 79a809a407
commit 11e0766184
116 changed files with 1053 additions and 264 deletions

View File

@@ -1,11 +1,6 @@
## prometheus
Bastille Template to bootstrap Prometheus.
## Bootstrap
```shell
bastille bootstrap https://github.com/bastillebsd/templates
```
## Usage
```shell
bastille template TARGET net-mgmt/prometheus

View File

@@ -0,0 +1,21 @@
ARG version="2.8.77"
ARG username="semaphore"
ARG password="SEmaPh0rE"
ARG email="semaphore@example.com"
ARG dbusername="semaphore_user"
ARG dbname="semaphore_db"
ARG dbpassword="SEmaPh0rE"
ARG rootpassdb="SEmaPh0rE"
ARG ipadd=$(ifconfig | grep 'inet' | awk -F ' ' '{ print $2 }')
PKG semaphore mysql80-server
CP usr /
CMD curl -L -O -C - https://github.com/ansible-semaphore/semaphore/releases/download/v"${version}"/semaphore_"${version}"_freebsd_amd64.tar.gz
CMD tar -zxvf semaphore_"${version}"_freebsd_amd64.tar.gz -C /usr/local/bin/ semaphore
CMD sed -i '' 's/"user": "",/"user": "${dbusername}",/g' /usr/local/etc/semaphore/config.json
CMD sed -i '' 's/"pass": "",/"pass": "${dbpassword}",/g' /usr/local/etc/semaphore/config.json
CMD sed -i '' 's/"name": "",/"name": "${dbname}",/g' /usr/local/etc/semaphore/config.json
SYSRC mysql_enable=YES
SERVICE mysql-server start
CMD mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '"${rootpassdb}"';CREATE DATABASE "${dbname}";CREATE USER '"${dbusername}"'@'"${ipadd}"' IDENTIFIED WITH mysql_native_password BY '"${dbpassword}"';GRANT ALL ON "${dbname}".* TO '"${dbusername}"'@'"${ipadd}"';FLUSH PRIVILEGES;";
CMD semaphore user add --admin --login "${username}" --name "${username}" --email "${email}" --password ${password}
CMD nohup semaphore server --config /usr/local/etc/semaphore/config.json &

View File

@@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2022, Christer Edwards <christer.edwards@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,9 @@
## semaphore
Bastille Template for Semaphore
## Usage
```shell
ishmael ~ # bastille template TARGET bastillebsd-templates/semaphore
```

View File

@@ -0,0 +1,59 @@
{
"mysql": {
"host": "127.0.0.1:3306",
"user": "",
"pass": "",
"name": "",
"options": null
},
"bolt": {
"host": "",
"user": "",
"pass": "",
"name": "",
"options": null
},
"postgres": {
"host": "",
"user": "",
"pass": "",
"name": "",
"options": null
},
"dialect": "mysql",
"port": "",
"interface": "",
"tmp_path": "/tmp/semaphore",
"cookie_hash": "",
"cookie_encryption": "",
"access_key_encryption": "",
"email_sender": "",
"email_host": "",
"email_port": "",
"email_username": "",
"email_password": "",
"web_host": "",
"ldap_binddn": "",
"ldap_bindpassword": "",
"ldap_server": "",
"ldap_searchdn": "",
"ldap_searchfilter": "",
"ldap_mappings": {
"dn": "",
"mail": "",
"uid": "",
"cn": ""
},
"telegram_chat": "",
"telegram_token": "",
"slack_url": "",
"max_parallel_tasks": 0,
"email_alert": false,
"email_secure": false,
"telegram_alert": false,
"slack_alert": false,
"ldap_enable": false,
"ldap_needtls": false,
"ssh_config_path": "",
"demo_mode": false
}

View File

@@ -1,11 +1,6 @@
## telegraf
Bastille Template to bootstrap Telegraf
## Bootstrap
```shell
bastille bootstrap https://github.com/bastillebsd/templates
```
## Usage
```shell
bastille template TARGET net-mgmt/telegraf

View File

@@ -0,0 +1,4 @@
ARG version=7
PKG unifi"${version}"
SYSRC unifi_enable="YES"
SERVICE unifi start

7
net-mgmt/unifi/README.md Normal file
View File

@@ -0,0 +1,7 @@
# Unifi
Bastille template to bootstrap Unifi
## Usage
```shell
bastille template TARGET bastillebsd-templates/unifi
```

View File

@@ -0,0 +1,4 @@
PKG zabbix54-agent
CMD cp /usr/local/etc/zabbix54/zabbix_agentd.conf.sample /usr/local/etc/zabbix54/zabbix_agentd.conf
SYSRC zabbix_agentd_enable=YES
SERVICE zabbix_agentd start

View File

@@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2019-2021, Christer Edwards <christer.edwards@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,27 @@
## Status
[![pipeline status](https://gitlab.com/bastillebsd-templates/zabbix-agent/badges/master/pipeline.svg)](https://gitlab.com/bastillebsd-templates/zabbix-agent/commits/master)
## Usage
```shell
bastille template TARGET bastillebsd-templates/zabbix-agent
```
## Post Install Steps
Once this is done running there are a couple of manual steps you have to do. First edit the file
/usr/local/etc/zabbix5/zabbix_agentd.conf
and edit the following lines with your server ip/hostname, and your client's hostname:
Server=1.1.1.1
ServerActive=1.1.1.1
Hostname=hostname.domain.tld
then restart the zabbix agent:
```shell
bastille service TARGET zabbix-agentd restart
```
and at this point you can add this client to your zabbix server.

View File

@@ -0,0 +1,25 @@
INCLUDE bastillebsd-templates/nginx
INCLUDE bastillebsd-templates/mysql-server
PKG zabbix54-server zabbix54-frontend zabbix54-agent
SYSRC zabbix_server_enable=YES
SYSRC zabbix_agentd_enable=YES
SYSRC nginx_enable=YES
## Make the needed SCRIPTS directory
#CMD mkdir /usr/local/etc/zabbix5/scripts
## Overlay to the system the scripts needed
#OVERLAY zfs-discovery.sh /usr/local/zabbix5/scripts
#OVERLAY zpool-discovery.sh /usr/local/zabbix5/scripts
#OVERLAY nginx.conf /usr/local/etc/nginx/nginx.conf
# Set the correct owner for the scipts directory
#CMD chown -R zabbix /usr/lcoal/etc/zabbix5/scripts
#CMD chmod +x /usr/local/etc/zabbix5/scripts
CMD cp /usr/local/etc/zabbix54/zabbix_agentd.conf.sample /usr/local/etc/zabbix54/zabbix_agentd.conf
CMD cp /usr/local/etc/zabbix54/zabbix_server.conf.sample /usr/local/etc/zabbix54/zabbix_server.conf
SERVICE zabbix_agentd start
SERVICE zabbix_server start

View File

@@ -0,0 +1,9 @@
## zabbix-server
Bastille template to bootstrap zabbix-server
## Usage
```shell
bastille template TARGET bastillebsd-templates/zabbix-server
```