Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
c97b7846ce | |||
2e2ac16aa1 | |||
c2591142bf | |||
a5c3cf3825 | |||
e4164ffb7c | |||
b72b2c2aa5 | |||
67340419cb | |||
3526354c05 | |||
13213e4bf7 |
10
README.md
10
README.md
@ -1,9 +1,10 @@
|
|||||||
# vagrant
|
# vagrant
|
||||||
|
|
||||||
le 2023-01-29
|
le 2023-06-25 00h30 - ps
|
||||||
|
|
||||||
Ce dépôt héberge des **Vagrantfile** dont
|
Ce dépôt héberge des **Vagrantfile** dont :
|
||||||
* **dns** : Vagrantfile pour 2 serveurs **Bind9** (1 maitre et un esclave), tests **goss** chainés
|
* **dns** : Vagrantfile pour 2 serveurs **Bind9** (1 maitre et un esclave), tests **goss** chainés
|
||||||
|
* **divers/logs** : Vagrantfile pour serveur et client **rsyslog** sans journald
|
||||||
* **docker**
|
* **docker**
|
||||||
* **docker-wordpress**
|
* **docker-wordpress**
|
||||||
* **docker-glpi**
|
* **docker-glpi**
|
||||||
@ -13,8 +14,13 @@ Ce dépôt héberge des **Vagrantfile** dont
|
|||||||
* **docker-traefik-nginx**
|
* **docker-traefik-nginx**
|
||||||
* **docker-elk**
|
* **docker-elk**
|
||||||
* **devstack**
|
* **devstack**
|
||||||
|
* **dvlpt** : Vagrantfile pour VM Debian 11 LAMP + phpmyadmin
|
||||||
|
* **glpi** : Vagrantfile pour VM Debian 11 GLPI 10.0.7
|
||||||
* **guacamole** : Vagrantfile pour Apache Guacamole dockerise sans frontal
|
* **guacamole** : Vagrantfile pour Apache Guacamole dockerise sans frontal
|
||||||
* **k8s** : kubernetes 1.26.00 + playbook pour master **k8s-master** et 2 noeuds **node-1** et **node-2**
|
* **k8s** : kubernetes 1.26.00 + playbook pour master **k8s-master** et 2 noeuds **node-1** et **node-2**
|
||||||
|
* **k3s-awx** : Vagrantfile + script **inst-awx** pour installation **Ansible AWX** sur **k3s** avec **awx-on-k3s**
|
||||||
* **minione**
|
* **minione**
|
||||||
* **rundeck** : Vagrantfile + playbook pour installation avec Mariadb
|
* **rundeck** : Vagrantfile + playbook pour installation avec Mariadb
|
||||||
|
* **samba-ad-dc** : Vagrantfile + playbook pour **Samba 4.17 ad-dc** sur **Debian 12 Bookworm**
|
||||||
|
|
||||||
* **wp-lb** : Wordpress web1 et web2, lb HaProxy, nfs, db Mariadb - Vagrantfile + playbooks
|
* **wp-lb** : Wordpress web1 et web2, lb HaProxy, nfs, db Mariadb - Vagrantfile + playbooks
|
||||||
|
28
divers/logs/Vagrantfile
vendored
Normal file
28
divers/logs/Vagrantfile
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.define 'srv' do |config|
|
||||||
|
config.vm.box = "debian/bullseye64"
|
||||||
|
config.vm.hostname = "srv"
|
||||||
|
config.vm.network "private_network", ip: "192.168.56.10"
|
||||||
|
config.vm.provision "shell", inline:<<-SHELL
|
||||||
|
# apt-get update
|
||||||
|
# apt-get install -y vim curl wget
|
||||||
|
sed -i 's/^#module\(load="imudp"\)/module(load="imudp")/' /etc/rsyslog.conf
|
||||||
|
sed -i 's/^#input\(type="imudp" port="514"\)/input(type="imudp" port="514")/' /etc/rsyslog.conf
|
||||||
|
systemctl restart syslog
|
||||||
|
ss -lnu
|
||||||
|
SHELL
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define 'cli' do |config|
|
||||||
|
config.vm.box = "debian/bullseye64"
|
||||||
|
config.vm.hostname = "cli"
|
||||||
|
config.vm.network "private_network", ip: "192.168.56.11"
|
||||||
|
config.vm.provision "shell", inline:<<-SHELL
|
||||||
|
# apt-get update
|
||||||
|
# apt-get install -y vim curl wget
|
||||||
|
echo "*.* @192.168.56.10" >> /etc/rsyslog.conf
|
||||||
|
systemctl restart syslog
|
||||||
|
logger salut
|
||||||
|
SHELL
|
||||||
|
end
|
||||||
|
end
|
32
docker-app/docker-compose.yml
Normal file
32
docker-app/docker-compose.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
php:
|
||||||
|
container_name: php
|
||||||
|
# image: php:apache
|
||||||
|
build: './php'
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
volumes:
|
||||||
|
- ./code:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
db:
|
||||||
|
container_name: db
|
||||||
|
image: mariadb
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
|
||||||
|
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||||
|
MYSQL_USER: ${MYSQL_USER}
|
||||||
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- ./db:/var/lib/mysql
|
||||||
|
- ./db-init:/docker-entrypoint-initdb.d
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
|
||||||
|
|
25
dvlpt/README.md
Normal file
25
dvlpt/README.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# dvlpt
|
||||||
|
|
||||||
|
**dvlpt** est une VM Debian 11 avec :
|
||||||
|
* **apache2**
|
||||||
|
* **php** (7.4)
|
||||||
|
* **mariadb-server**
|
||||||
|
* **phpmyadmin**
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
vagrant up
|
||||||
|
|
||||||
|
|
||||||
|
## Utilisation
|
||||||
|
|
||||||
|
**Acces SSH** : vagrant ssh
|
||||||
|
|
||||||
|
**Acces web** : http://localhost:2080
|
||||||
|
|
||||||
|
**Acces phpmyadmin** : http://localhost:2080/phpmyadmin
|
||||||
|
|
||||||
|
**Acces ssh** : ssh root@localhost -p 2022
|
||||||
|
|
||||||
|
le 2023-05-04
|
||||||
|
|
83
dvlpt/Vagrantfile
vendored
Normal file
83
dvlpt/Vagrantfile
vendored
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# -*- 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/bullseye64"
|
||||||
|
config.vm.hostname = "dvlpt"
|
||||||
|
|
||||||
|
# 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: 22, host: 2022
|
||||||
|
config.vm.network "forwarded_port", guest: 80, host: 2080
|
||||||
|
|
||||||
|
# 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 "private_network", ip: "192.168.33.10"
|
||||||
|
|
||||||
|
# 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
|
||||||
|
timedatectl set-timezone Europe/Paris
|
||||||
|
apt-get update
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y vim wget curl git apache2 php php-mysql php-gd php-xml mariadb-server phpmyadmin
|
||||||
|
cp /etc/phpmyadmin/apache.conf /etc/apache2/sites-available/phpmyadmin.conf
|
||||||
|
a2ensite phpmyadmin.conf
|
||||||
|
systemctl restart apache2
|
||||||
|
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
||||||
|
systemctl restart ssh
|
||||||
|
echo 'connexion SSH avec vagrant : vagrant ssh'
|
||||||
|
echo 'connexion SSH : ssh root@localhost -p 2022'
|
||||||
|
echo 'connexion web : http://localhost:2080'
|
||||||
|
echo 'connexion phpmyadmin : http://localhost:2080/phpmyadmin'
|
||||||
|
SHELL
|
||||||
|
end
|
34
glpi/README.md
Normal file
34
glpi/README.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# GLPI
|
||||||
|
|
||||||
|
**glpi** installe une VM Debian 11 avec :
|
||||||
|
* **apache2**
|
||||||
|
* **php** (7.4) et les paquets associés
|
||||||
|
* **mariadb-server**
|
||||||
|
* **GLPI** 10.0.7
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
vagrant up
|
||||||
|
|
||||||
|
### se connecter à la VM :
|
||||||
|
vagrant ssh
|
||||||
|
|
||||||
|
|
||||||
|
sudo mysql_secure_administration
|
||||||
|
|
||||||
|
### avec un navigateur :
|
||||||
|
|
||||||
|
se connecter à l'URL http://loclahost:2080/glpi
|
||||||
|
|
||||||
|
lancer l'installation de **GLPI**
|
||||||
|
|
||||||
|
## Utilisation
|
||||||
|
|
||||||
|
**Acces SSH** : vagrant ssh
|
||||||
|
|
||||||
|
**Acces web** : http://localhost:2080
|
||||||
|
|
||||||
|
**Acces ssh** : ssh root@localhost -p 2022
|
||||||
|
|
||||||
|
le 2023-05-04
|
||||||
|
|
91
glpi/Vagrantfile
vendored
Normal file
91
glpi/Vagrantfile
vendored
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# -*- 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/bullseye64"
|
||||||
|
config.vm.hostname = "glpi"
|
||||||
|
|
||||||
|
# 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: 22, host: 2022
|
||||||
|
config.vm.network "forwarded_port", guest: 80, host: 2080
|
||||||
|
|
||||||
|
# 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 "private_network", ip: "192.168.33.10"
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# export http_proxy=http://10.121.38.1:8080
|
||||||
|
# export https_proxy=http://10.121.38.1:8080
|
||||||
|
timedatectl set-timezone Europe/Paris
|
||||||
|
apt-get update
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y vim wget curl git apache2 php php-mysql php-ldap php-gd php-intl php-xml php-curl php-zip mariadb-server
|
||||||
|
( cd /var/www/html
|
||||||
|
wget https://github.com/glpi-project/glpi/releases/download/10.0.7/glpi-10.0.7.tgz
|
||||||
|
tar xvfz glpi-10.0.7.tgz
|
||||||
|
chown -R root:root glpi
|
||||||
|
cd glpi
|
||||||
|
chown -R www-data:www-data files config
|
||||||
|
)
|
||||||
|
|
||||||
|
# systemctl restart apache2
|
||||||
|
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
||||||
|
systemctl restart ssh
|
||||||
|
echo 'connexion SSH avec vagrant : vagrant ssh'
|
||||||
|
echo 'connexion SSH : ssh root@localhost -p 2022'
|
||||||
|
echo 'connexion web : http://localhost:2080'
|
||||||
|
echo 'connexion phpmyadmin : http://localhost:2080/glpi'
|
||||||
|
SHELL
|
||||||
|
end
|
72
k3s-awx/Vagrantfile
vendored
Normal file
72
k3s-awx/Vagrantfile
vendored
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
# -*- 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/bullseye64"
|
||||||
|
config.vm.hostname = "k3s-awx"
|
||||||
|
|
||||||
|
# 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 "private_network", ip: "192.168.56.10"
|
||||||
|
|
||||||
|
# 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 = "3072"
|
||||||
|
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 install -y curl vim git make
|
||||||
|
SHELL
|
||||||
|
end
|
||||||
|
|
36
k3s-awx/inst-awx
Normal file
36
k3s-awx/inst-awx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# installation awx sur k3s
|
||||||
|
export NAMESPACE=awx
|
||||||
|
AWX_HOST="awx.sio.lan"
|
||||||
|
REL="2.0.1"
|
||||||
|
[ -x /usr/local/bin/k3s-uninstall.sh ] && /usr/local/bin/k3s-uninstall.sh
|
||||||
|
sudo rm -rf /data
|
||||||
|
sudo rm -rf awx*
|
||||||
|
export NAMESPACE=awx
|
||||||
|
#export http_proxy=http://10.121.38.1:8080
|
||||||
|
#export https_proxy=http://10.121.38.1:8080
|
||||||
|
|
||||||
|
curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644
|
||||||
|
cd ~
|
||||||
|
git clone https://github.com/ansible/awx-operator.git
|
||||||
|
cd awx-operator
|
||||||
|
git checkout "${REL}"
|
||||||
|
export NAMESPACE=awx
|
||||||
|
make deploy
|
||||||
|
kubectl -n awx get all
|
||||||
|
|
||||||
|
cd ~
|
||||||
|
git clone https://github.com/kurokobo/awx-on-k3s.git
|
||||||
|
cd awx-on-k3s
|
||||||
|
git checkout "${REL}"
|
||||||
|
#AWX_HOST="awx.sio.lan"
|
||||||
|
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -out ./base/tls.crt -keyout ./base/tls.key -subj "/CN=${AWX_HOST}/O=${AWX_HOST}" -addext "subjectAltName = DNS:${AWX_HOST}"
|
||||||
|
sed -i "s/awx.example.com/${AWX_HOST}/" base/awx.yaml
|
||||||
|
sudo mkdir -p /data/postgres-13
|
||||||
|
sudo mkdir -p /data/projects
|
||||||
|
sudo chmod 755 /data/postgres-13
|
||||||
|
sudo chown 1000:0 /data/projects
|
||||||
|
kubectl apply -k base
|
||||||
|
kubectl -n awx logs -f deployments/awx-operator-controller-manager
|
||||||
|
kubectl -n awx get awx,all,ingress,secrets
|
||||||
|
|
78
samba-ad-dc/Vagrantfile
vendored
Normal file
78
samba-ad-dc/Vagrantfile
vendored
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# -*- 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/bookworm64"
|
||||||
|
config.vm.hostname = "dc1"
|
||||||
|
|
||||||
|
# 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 "private_network", ip: "192.168.33.10"
|
||||||
|
config.vm.network "private_network", ip: "192.168.56.10"
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
# Disable the default share of the current code directory. Doing this
|
||||||
|
# provides improved isolation between the vagrant box and your host
|
||||||
|
# by making sure your Vagrantfile isn't accessable to the vagrant box.
|
||||||
|
# If you use this you may want to enable additional shared subfolders as
|
||||||
|
# shown above.
|
||||||
|
# config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
|
||||||
|
# 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 "ansible" do |ansible|
|
||||||
|
ansible.playbook = "playbook.yml"
|
||||||
|
end
|
||||||
|
end
|
186
samba-ad-dc/playbook.yml
Normal file
186
samba-ad-dc/playbook.yml
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
|
vars:
|
||||||
|
samba_dc_dns_domain: "ad.sio.lan"
|
||||||
|
samba_dc_hostname: "dc1.ad.sio.lan"
|
||||||
|
samba_dc_hostname_short: "dc1"
|
||||||
|
samba_dc_ip: "192.168.56.10"
|
||||||
|
samba_dc_net: "192.168.56.0/24"
|
||||||
|
samba_dc_realm: "AD.SIO.LAN"
|
||||||
|
samba_dc_workgroup: "AD"
|
||||||
|
samba_dc_domain: "AD"
|
||||||
|
samba_dc_admin_password: "Azerty1+"
|
||||||
|
samba_dc_dns_backend: "SAMBA_INTERNAL" # ou bien "BIND9_DLZ"
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
- name: Set timezone to Europe/Paris
|
||||||
|
timezone:
|
||||||
|
name: Europe/Paris
|
||||||
|
|
||||||
|
- name: Update apt cache if needed.
|
||||||
|
apt:
|
||||||
|
update_cache: true
|
||||||
|
cache_valid_time: 3600
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Pre - set hostname {{ samba_dc_hostname }}
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
{{ samba_dc_hostname }}
|
||||||
|
dest: /etc/hostname
|
||||||
|
|
||||||
|
- name: Pre - set /etc/hosts
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
127.0.0.1 localhost
|
||||||
|
{{ samba_dc_ip }} {{ samba_dc_hostname }} {{ samba_dc_hostname_short }}
|
||||||
|
dest: /etc/hosts
|
||||||
|
|
||||||
|
- name: Pre - "Installe paquets de base"
|
||||||
|
ansible.builtin.apt:
|
||||||
|
state: present
|
||||||
|
name:
|
||||||
|
- acl
|
||||||
|
- git
|
||||||
|
- curl
|
||||||
|
- wget
|
||||||
|
- sudo
|
||||||
|
- unzip
|
||||||
|
- vim
|
||||||
|
- gnupg
|
||||||
|
- tmux
|
||||||
|
- dnsutils
|
||||||
|
- apt-transport-https
|
||||||
|
- chrony
|
||||||
|
|
||||||
|
- name: Samba - "Installe paquets Samba"
|
||||||
|
ansible.builtin.apt:
|
||||||
|
state: present
|
||||||
|
name:
|
||||||
|
- samba
|
||||||
|
- winbind
|
||||||
|
- libnss-winbind
|
||||||
|
- krb5-user
|
||||||
|
- smbclient
|
||||||
|
- ldb-tools
|
||||||
|
- python3-cryptography
|
||||||
|
|
||||||
|
- name: Samba - Configuration Kerberos
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
[libdefaults]
|
||||||
|
default_realm = {{ samba_dc_realm }}
|
||||||
|
dns_lookup_kdc = true
|
||||||
|
dns_lookup_realm = false
|
||||||
|
dest: /etc/krb5.conf
|
||||||
|
|
||||||
|
- name: Samba - Nettoie smb.conf
|
||||||
|
file:
|
||||||
|
path: "/etc/samba/smb.conf"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Samba - Configure DC
|
||||||
|
command: samba-tool domain provision --realm={{ samba_dc_realm }} --domain {{ samba_dc_domain }} --server-role=dc
|
||||||
|
|
||||||
|
- name: Samba - Mdp Administrator
|
||||||
|
command: samba-tool user setpassword administrator --newpassword={{ samba_dc_admin_password }}
|
||||||
|
|
||||||
|
- name: Samba - Set dns forwarder .
|
||||||
|
lineinfile:
|
||||||
|
dest: "/etc/samba/smb.conf"
|
||||||
|
regexp: "dns forwarder =.*"
|
||||||
|
line: "dns forwarder = 9.9.9.9"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Samba - set resolv.conf
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
search {{ samba_dc_dns_domain }}
|
||||||
|
nameserver 127.0.0.1
|
||||||
|
dest: /etc/resolv.conf
|
||||||
|
|
||||||
|
- name: Samba - rm krb5.conf dans samba
|
||||||
|
file:
|
||||||
|
path: /var/lib/samba/private/krb5.conf
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Samba - ln krb5.conf de samba vers standard
|
||||||
|
file:
|
||||||
|
src: /etc/krb5.conf
|
||||||
|
dest: /var/lib/samba/private/krb5.conf
|
||||||
|
force: true
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: SAmba - unmask and enable samba-ad-dc
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: samba-ad-dc
|
||||||
|
masked: false
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
- name: Samba - mask samba
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: samba
|
||||||
|
masked: true
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
- name: Samba - mask winbind
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: winbind
|
||||||
|
masked: true
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
- name: Samba - mask smbd
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: smbd
|
||||||
|
masked: true
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
- name: Samba - mask nmbd
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: nmbd
|
||||||
|
masked: true
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
- name: Samba - reboot
|
||||||
|
reboot:
|
||||||
|
|
||||||
|
- name: Samba - set resolv.conf
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
search {{ samba_dc_dns_domain }}
|
||||||
|
nameserver 127.0.0.1
|
||||||
|
dest: /etc/resolv.conf
|
||||||
|
|
||||||
|
|
||||||
|
- name: Samba - Test smbclient
|
||||||
|
command: smbclient -L localhost -N
|
||||||
|
|
||||||
|
- name: SAmba - test DNS SRV _ldap sur TCP
|
||||||
|
command: host -t SRV _ldap._tcp.{{ samba_dc_dns_domain }}
|
||||||
|
|
||||||
|
- name: Samba - test DNS SRV _kerberos sur UDP
|
||||||
|
command: host -t SRV _kerberos._udp.{{ samba_dc_dns_domain }}
|
||||||
|
|
||||||
|
- name: Samba - test DNS A pour dc
|
||||||
|
command: host -t A {{ samba_dc_hostname }}
|
||||||
|
|
||||||
|
- name: Chrony - configuration
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: /etc/chrony/chrony.conf
|
||||||
|
block: |
|
||||||
|
bindcmdaddress {{ samba_dc_ip }}
|
||||||
|
|
||||||
|
# The source, where we are receiving the time from
|
||||||
|
server 0.pool.ntp.org iburst
|
||||||
|
server 1.pool.ntp.org iburst
|
||||||
|
server 2.pool.ntp.org iburst
|
||||||
|
|
||||||
|
allow {{ samba_dc_net }}
|
||||||
|
|
||||||
|
- name: Chrony - redemarrage
|
||||||
|
service:
|
||||||
|
name: chrony
|
||||||
|
state: restarted
|
||||||
|
|
Reference in New Issue
Block a user