Compare commits

...

11 Commits

Author SHA1 Message Date
a5c3cf3825 glpi + timezone 2023-05-05 00:04:54 +02:00
e4164ffb7c MAJ README.md 2023-05-04 11:47:46 +02:00
b72b2c2aa5 ajout dvpt : lAMP + phpmyadmin 2023-05-04 11:43:27 +02:00
67340419cb ajout logs 2023-04-25 20:56:28 +02:00
3526354c05 ajout k3s-awx 2023-04-25 20:32:51 +02:00
13213e4bf7 ajout app docker LAMP 2023-03-30 22:03:38 +00:00
43e8eb5911 typo ... 2023-02-03 13:56:12 +01:00
b24ef44c4a deplac. install goss 2023-02-03 13:45:22 +01:00
e195c6b4c7 pb mkzone 2023-02-03 13:22:46 +01:00
535675494a typo mkzone 2023-02-03 13:12:57 +01:00
ade43e2369 modif nxc ok avec TLS 2023-01-29 23:35:26 +01:00
15 changed files with 644 additions and 96 deletions

View File

@ -1,9 +1,10 @@
# vagrant
le 2023-01-29
le 2023-05-04 11h46 - 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
* **divers/logs** : Vagrantfile pour serveur et client **rsyslog** sans journald
* **docker**
* **docker-wordpress**
* **docker-glpi**
@ -13,8 +14,11 @@ Ce dépôt héberge des **Vagrantfile** dont
* **docker-traefik-nginx**
* **docker-elk**
* **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
* **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**
* **rundeck** : Vagrantfile + playbook pour installation avec Mariadb
* **wp-lb** : Wordpress web1 et web2, lb HaProxy, nfs, db Mariadb - Vagrantfile + playbooks

View File

@ -8,7 +8,7 @@ trap cleanup SIGINT SIGTERM ERR EXIT
# - ficher de zone inverse
#
version="1.1"
version="1.1a"
zone="domaine.lan"
slave=0
@ -54,6 +54,7 @@ zone "${zone}" {
zone "${zonerev}" {
type master;
file "/etc/bind/db.${zone}.rev"; # zone directe
};
EOT
else
@ -78,7 +79,7 @@ EOT
fi
}
mkzdirrect () {
mkzdirect () {
# fichier de zone directe
echo "Generation fichier de zone directe db.${zone} ..."
cat <<EOT > "db.${zone}"

28
divers/logs/Vagrantfile vendored Normal file
View 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

View File

@ -3,6 +3,7 @@ set -eu
mondomaine=domaine.lan
apt-get install -y bind9 bind9-doc bind9-host
curl -fsSL https://goss.rocks/install |sh
wget -nc https://gitea.lyc-lecastel.fr/gadmin/vagrant/raw/branch/main/divers/bind/mkzone
bash mkzone "${mondomaine}"
cp db.${mondomaine}* /etc/bind
@ -14,7 +15,6 @@ host srv1
host srv2
host -t soa "${mondomaine}"
host -l "${mondomaine}"
curl -fsSL https://goss.rocks/install |sh
goss add command "host ${mondomaine}"
goss add command "host -t soa ${mondomaine}"
goss add command "host -t ns ${mondomaine}"

View File

@ -7,7 +7,7 @@ wget -nc https://gitea.lyc-lecastel.fr/gadmin/vagrant/raw/branch/main/divers/bin
bash mkzone -s "${mondomaine}"
cp named.conf.local /etc/bind
sudo named-checkconf /etc/bind/named.conf
sudo named-checkzone "${mondomaine}" "/etc/bind/db.${mondomaine}"
sudo named-checkzone "${mondomaine}" "/var/cache/bind/db.${mondomaine}"
sudo systemctl restart bind9
host srv1
host srv2

View 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

View File

@ -64,95 +64,8 @@ Vagrant.configure("2") do |config|
# 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 install -y wget curl git vim
if ! which docker ; then
curl -s -o getdocker.sh https://get.docker.com
bash getdocker.sh
gpasswd -a vagrant docker
fi
mkdir -p nextcloud && cd nextcloud
cat > traefik.yml <<-'EOT'
version: '3'
networks:
proxy:
external: true
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.9
container_name: traefik
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
networks:
- proxy
'EOT'
cat > nextcloud.yml <<-'EOT'
version: '2'
volumes:
nextcloud:
db:
networks:
proxy:
external: true
nxc:
external: false
services:
db:
image: mariadb:10.5
container_name: db
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- db:/var/lib/mysql
networks:
- nxc
environment:
- MYSQL_ROOT_PASSWORD=Azerty1+
- MYSQL_PASSWORD=Azerty1+
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
app:
image: nextcloud
container_name: app
restart: always
# ports:
# - 8081:80
links:
- db
volumes:
- nextcloud:/var/www/html
networks:
- proxy
- nxc
labels:
- "traefik.http.routers.app.rule=Host(`mon.nxc`)"
environment:
- MYSQL_PASSWORD=Azerty1+
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
'EOT'
docker network create proxy
docker compose -f traefik.yml up -d
docker compose -f nextcloud.yml up -d
ip -br a
SHELL
config.vm.provision "shell",
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
config.vm.provision "shell", path: "provision/setup.sh"
end

View File

@ -0,0 +1,82 @@
version: '3'
volumes:
nextcloud:
db:
networks:
proxy:
external: true
nxc:
external: false
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:latest
container_name: traefik
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock:ro
# Map the static configuration into the container
- ./config/static.yml:/etc/traefik/traefik.yml:ro
# Map the dynamic configuration into the container
- ./config/dynamic.yml:/etc/traefik/dynamic.yml:ro
# Map the certificats into the container
- ./certs:/etc/certs:ro
networks:
- proxy
db:
image: mariadb:10.5
container_name: db
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- db:/var/lib/mysql
networks:
- nxc
environment:
- MYSQL_ROOT_PASSWORD=Azerty1+
- MYSQL_PASSWORD=Azerty1+
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
app:
image: nextcloud
container_name: app
restart: always
ports:
- 8081:80
#links:
depends_on:
- db
volumes:
- nextcloud:/var/www/html
networks:
- proxy
- nxc
labels:
# - "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`mon.nxc`)"
- "traefik.http.routers.app.tls=true"
- "traefik.enable=true"
- "traefik.docker.network=proxy"
# - "traefik.http.routers.app.entrypoints=websecure"
# - "traefik.http.routers.app.rule=Host(`mon.nxc`)"
- "traefik.http.routers.app.service=app-service"
- "traefik.http.services.app-service.loadbalancer.server.port=80"
environment:
- MYSQL_PASSWORD=Azerty1+
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db

View File

@ -0,0 +1,161 @@
#!/bin/bash
apt-get update
apt-get install -y wget curl git vim
if ! which docker ; then
curl -s -o getdocker.sh https://get.docker.com
bash getdocker.sh
gpasswd -a vagrant docker
fi
mkdir -p nextcloud && cd nextcloud
wget -O mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64
chmod +x mkcert
mv mkcert /usr/local/bin
sudo apt-get install -y libnss3-tools
mkdir certs config
mkcert -install
mkcert -cert-file certs/local-cert.pem -key-file certs/local-key.pem "mon.nxc" "*.mon.nxc"
cat > traefik.yml <<EOT
version: '3'
networks:
proxy:
external: true
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:latest
container_name: traefik
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock:ro
# Map the static configuration into the container
- ./config/static.yml:/etc/traefik/traefik.yml:ro
# Map the dynamic configuration into the container
- ./config/dynamic.yml:/etc/traefik/dynamic.yml:ro
# Map the certificats into the container
- ./certs:/etc/certs:ro
networks:
- proxy
EOT
cat > ./config/static.yml <<EOT
global:
sendAnonymousUsage: false
api:
dashboard: true
insecure: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
watch: true
exposedByDefault: false
file:
filename: /etc/traefik/dynamic.yml
watch: true
log:
level: INFO
format: common
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
https:
address: ":443"
EOT
cat > ./config/dynamic.yml <<EOT
http:
routers:
traefik:
rule: "Host(`traefik.docker.localhost`)"
service: "api@internal"
tls:
domains:
- main: "docker.localhost"
sans:
- "*.docker.localhost"
- main: "mon.nxc"
sans:
- "*.mon.nxc"
tls:
certificates:
- certFile: "/etc/certs/local-cert.pem"
keyFile: "/etc/certs/local-key.pem"
EOT
cat > nextcloud.yml <<'EOT'
version: '2'
volumes:
nextcloud:
db:
networks:
proxy:
external: true
nxc:
external: false
services:
db:
image: mariadb:10.5
container_name: db
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- db:/var/lib/mysql
networks:
- nxc
environment:
- MYSQL_ROOT_PASSWORD=Azerty1+
- MYSQL_PASSWORD=Azerty1+
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
app:
image: nextcloud
container_name: app
restart: always
# ports:
# - 8081:80
#links:
depends_on:
- db
volumes:
- nextcloud:/var/www/html
networks:
- proxy
- nxc
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`mon.nxc`)"
- "traefik.http.routers.app.tls=true"
environment:
- MYSQL_PASSWORD=Azerty1+
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
'EOT'
docker network create proxy
docker compose -f traefik.yml up -d
docker compose -f nextcloud.yml up -d
ip -br a

25
dvlpt/README.md Normal file
View 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
View 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

23
glpi/README.md Normal file
View File

@ -0,0 +1,23 @@
# 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
## Utilisation
**Acces SSH** : vagrant ssh
**Acces web** : http://localhost:2080
**Acces ssh** : ssh root@localhost -p 2022
le 2023-05-04

88
glpi/Vagrantfile vendored Normal file
View File

@ -0,0 +1,88 @@
# -*- 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
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 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
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
View 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
View 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