inst-depl inst1 et inst2
This commit is contained in:
parent
0d2968b2c8
commit
83a3942900
@ -1,77 +0,0 @@
|
|||||||
# -*- mode: ruby -*-
|
|
||||||
# vi: set ft=ruby :
|
|
||||||
|
|
||||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
|
||||||
# configures the configuration version (we support older styles for
|
|
||||||
# backwards compatibility). Please don't change it unless you know what
|
|
||||||
# you're doing.
|
|
||||||
Vagrant.configure("2") do |config|
|
|
||||||
# The most common configuration options are documented and commented below.
|
|
||||||
# For a complete reference, please see the online documentation at
|
|
||||||
# https://docs.vagrantup.com.
|
|
||||||
|
|
||||||
# Every Vagrant development environment requires a box. You can search for
|
|
||||||
# boxes at https://vagrantcloud.com/search.
|
|
||||||
config.vm.box = "debian/buster64"
|
|
||||||
config.vm.hostname = "s-adm"
|
|
||||||
config.vm.define "s-adm"
|
|
||||||
config.vm.provider :virtualbox do |vb|
|
|
||||||
vb.name = "s-adm"
|
|
||||||
end
|
|
||||||
# Disable automatic box update checking. If you disable this, then
|
|
||||||
# boxes will only be checked for updates when the user runs
|
|
||||||
# `vagrant box outdated`. This is not recommended.
|
|
||||||
# config.vm.box_check_update = false
|
|
||||||
|
|
||||||
# Create a forwarded port mapping which allows access to a specific port
|
|
||||||
# within the machine from a port on the host machine. In the example below,
|
|
||||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
|
||||||
# NOTE: This will enable public access to the opened port
|
|
||||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
|
||||||
|
|
||||||
# Create a forwarded port mapping which allows access to a specific port
|
|
||||||
# within the machine from a port on the host machine and only allow access
|
|
||||||
# via 127.0.0.1 to disable public access
|
|
||||||
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
|
|
||||||
|
|
||||||
# Create a private network, which allows host-only access to the machine
|
|
||||||
# using a specific IP.
|
|
||||||
config.vm.network "public_network", ip: "192.168.1.91"
|
|
||||||
config.vm.network "private_network", ip: "192.168.99.99"
|
|
||||||
|
|
||||||
# Create a public network, which generally matched to bridged network.
|
|
||||||
# Bridged networks make the machine appear as another physical device on
|
|
||||||
# your network.
|
|
||||||
# config.vm.network "public_network"
|
|
||||||
|
|
||||||
# Share an additional folder to the guest VM. The first argument is
|
|
||||||
# the path on the host to the actual folder. The second argument is
|
|
||||||
# the path on the guest to mount the folder. And the optional third
|
|
||||||
# argument is a set of non-required options.
|
|
||||||
# config.vm.synced_folder "../data", "/vagrant_data"
|
|
||||||
|
|
||||||
# Provider-specific configuration so you can fine-tune various
|
|
||||||
# backing providers for Vagrant. These expose provider-specific options.
|
|
||||||
# Example for VirtualBox:
|
|
||||||
#
|
|
||||||
# config.vm.provider "virtualbox" do |vb|
|
|
||||||
# # Display the VirtualBox GUI when booting the machine
|
|
||||||
# vb.gui = true
|
|
||||||
#
|
|
||||||
# # Customize the amount of memory on the VM:
|
|
||||||
# vb.memory = "1024"
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
# View the documentation for the provider you are using for more
|
|
||||||
# information on available options.
|
|
||||||
|
|
||||||
# Enable provisioning with a shell script. Additional provisioners such as
|
|
||||||
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
|
|
||||||
# documentation for more information about their specific syntax and use.
|
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
|
||||||
apt-get update
|
|
||||||
apt-get upgrade
|
|
||||||
apt-get install -y vim wget curl
|
|
||||||
# apt-get install -y apache2
|
|
||||||
SHELL
|
|
||||||
end
|
|
0
pre/gsbboot
Normal file → Executable file
0
pre/gsbboot
Normal file → Executable file
38
pre/inst-depl
Normal file → Executable file
38
pre/inst-depl
Normal file → Executable file
@ -29,12 +29,12 @@ WPREL=6.4.2
|
|||||||
#v6.1.1 le 17/01/2023
|
#v6.1.1 le 17/01/2023
|
||||||
str5="wget -nc -4 https://fr.wordpress.org/latest-fr_FR.tar.gz -O wordpress-6.4.2-fr_FR.tar.gz"
|
str5="wget -nc -4 https://fr.wordpress.org/latest-fr_FR.tar.gz -O wordpress-6.4.2-fr_FR.tar.gz"
|
||||||
|
|
||||||
str6="curl -L https://github.com/goss-org/goss/releases/latest/download/goss-linux-amd64 -o goss"
|
str6="curl -L -4 https://github.com/goss-org/goss/releases/latest/download/goss-linux-amd64 -o goss"
|
||||||
|
|
||||||
str7="curl -L https://github.com/goss-org/goss/releases/latest/download/dgoss -o dgoss"
|
str7="curl -L -4 https://github.com/goss-org/goss/releases/latest/download/dgoss -o dgoss"
|
||||||
|
|
||||||
#GESTSUPREL=3.2.30
|
#GESTSUPREL=3.2.30
|
||||||
#str8="wget -nc 'https://gestsup.fr/index.php?page=download&channel=stable&version=${GESTSUPREL}&type=gestsup' -O gestsup_${GESTSUPREL}.zip"
|
#str8="wget -nc -4 'https://gestsup.fr/index.php?page=download&channel=stable&version=${GESTSUPREL}&type=gestsup' -O gestsup_${GESTSUPREL}.zip"
|
||||||
str8="wget -nc -4 'https://gestsup.fr/index.php?page=download&channel=stable&version=3.2.30&type=gestsup' -O gestsup_3.2.30.zip"
|
str8="wget -nc -4 'https://gestsup.fr/index.php?page=download&channel=stable&version=3.2.30&type=gestsup' -O gestsup_3.2.30.zip"
|
||||||
|
|
||||||
#METRICBEAT ET FILEBEAT
|
#METRICBEAT ET FILEBEAT
|
||||||
@ -59,7 +59,7 @@ ${str7}
|
|||||||
|
|
||||||
chmod +x ./goss ./dgoss
|
chmod +x ./goss ./dgoss
|
||||||
|
|
||||||
curl -L https://get.docker.com -o getdocker.sh
|
curl -L -4 https://get.docker.com -o getdocker.sh
|
||||||
chmod +x ./getdocker.sh
|
chmod +x ./getdocker.sh
|
||||||
|
|
||||||
wget -nc -4 https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64 -O mkcert
|
wget -nc -4 https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64 -O mkcert
|
||||||
@ -77,8 +77,36 @@ EOT
|
|||||||
|
|
||||||
cat "${STOREREP}/getall"
|
cat "${STOREREP}/getall"
|
||||||
|
|
||||||
cd "${STOREREP}" || exit 2
|
cd "${STOREREP}" || exit 2
|
||||||
bash getall
|
bash getall
|
||||||
cp goss /usr/local/bin
|
cp goss /usr/local/bin
|
||||||
|
|
||||||
|
(cat <<EOT > "${STOREREP}/inst1"
|
||||||
|
#!/bin/bash
|
||||||
|
if [[ -z ${HOST+x} ]]; then
|
||||||
|
echo "erreur : variable HOST indefinie"
|
||||||
|
echo " HOST : adresse serveur deploiement"
|
||||||
|
echo "export HOST=s-xyzt ; ./$0"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
hostname=$(hostname)
|
||||||
|
echo "${HOST}" > /etc/hostname
|
||||||
|
hostnamectl set-hostname "${HOST}"
|
||||||
|
sed -i "s/${hostname}/${HOST}/g" /etc/host{s,name}
|
||||||
|
echo "vous pouvez redemarrer ..."
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
|
||||||
|
(cat <<EOT > "${STOREREP}/inst2"
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p ~/tools/ansible ; cd ~/tools/ansible
|
||||||
|
git clone https://gitea.lyc-lecastel.fr/gsb/gsb2024.git
|
||||||
|
cd gsb2024/pre
|
||||||
|
DEPL=192.168.99.99 bash gsbboot
|
||||||
|
cd ../.. ; bash pull-config
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -o errexit
|
|
||||||
set -o pipefail
|
|
||||||
GITUSR=gitgsb
|
|
||||||
GITPRJ=gsb
|
|
||||||
apt update && apt upgrade
|
|
||||||
apt install -y apache2 git
|
|
||||||
getent passwd "${GITUSR}" >> /dev/null
|
|
||||||
if [[ $? != 0 ]]; then
|
|
||||||
echo "creation utilisateur "${GITUSR}" ..."
|
|
||||||
/sbin/useradd -m -d /home/"${GITUSR}" -s /bin/bash "${GITUSR}"
|
|
||||||
echo "${GITUSR}:${GITUSR}" | /sbin/chpasswd
|
|
||||||
else
|
|
||||||
echo "utilisateur "${GITUSR}" existant..."
|
|
||||||
fi
|
|
||||||
su -c "git init --share --bare /home/${GITUSR}/${GITPRJ}.git" "${GITUSR}"
|
|
||||||
su -c "cd ${GITPRJ}.git/.git/hooks && mv post-update.sample post-update" "${GITUSR}"
|
|
||||||
[[ -h /var/www/html/"${GITPRJ}".git ]]|| ln -s /home/"${GITUSR}"/"${GITPRJ}".git /var/www/html/"${GITPRJ}".git
|
|
||||||
[[ -d /var/www/html/gsbstore ]]|| mkdir /var/www/html/gsbstore
|
|
||||||
|
|
||||||
(cat <<EOT > /var/www/html/gsbstore/getall
|
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
GLPIREL=9.4.5
|
|
||||||
wget -nc https://github.com/glpi-project/glpi/releases/download/\${GLPIREL}/glpi-\${GLPIREL}.tgz
|
|
||||||
|
|
||||||
FIREL=9.4+2.4
|
|
||||||
wget -nc -O fusioninventory-glpi\${FIREL}.tag.gz https://github.com/fusioninventory/fusioninventory-for-glpi/archive/glpi\${FIREL}.tar.gz
|
|
||||||
#https://github.com/fusioninventory/fusioninventory-for-glpi/archive/glpi9.4+2.4.tar.g
|
|
||||||
|
|
||||||
FIAGREL=2.5.2
|
|
||||||
wget -nc https://github.com/fusioninventory/fusioninventory-agent/releases/download/\${FIAGREL}/fusioninventory-agent_windows-x64_\${FIAGREL}.exe
|
|
||||||
|
|
||||||
wget -nc https://github.com/fusioninventory/fusioninventory-agent/releases/download/\$FIAGREL/fusioninventory-agent_windows-x86_\${FIAGREL}.exe
|
|
||||||
|
|
||||||
FOGREL=1.5.7
|
|
||||||
wget -nc https://github.com/FOGProject/fogproject/archive/\${FOGREL}.tar.gz -O fogproject-\${FOGREL}.tar.gz
|
|
||||||
|
|
||||||
wget -nc https://fr.wordpress.org/wordpress-5.3.2-fr_FR.tar.gz
|
|
||||||
|
|
||||||
EOT
|
|
||||||
)
|
|
||||||
cat /var/www/html/gsbstore/getall
|
|
||||||
|
|
0
pre/pull-config
Normal file → Executable file
0
pre/pull-config
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user