add OSname and OSVersion to servermodel/applicationservice
This commit is contained in:
parent
c18e9da258
commit
7edf9f7e4e
@ -1,4 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# + = = = = = = = = = = = = = = = = = = = = = = = = = = = +
|
||||
# " SITE cluster "
|
||||
# " +---------------------+ "
|
||||
# " | NEBULACLUSTER | "
|
||||
# " | cluster.cadoles.com | "
|
||||
# " +---------------------+ "
|
||||
# " | "
|
||||
# " +-------------------+ "
|
||||
# " | NODE | "-----------+
|
||||
# " | node1.cadoles.com | " |
|
||||
# " +-------------------+ " |
|
||||
# " | " +~~~~~~~~+
|
||||
# + = = = = = = = = = = = = = | = = = = = = = = = = = = = + ! ZONE !
|
||||
# | ! pedago !
|
||||
# + = = = = = = = = = = = = = | = = = = = = = = = = = = = + +~~~~~~~~+
|
||||
# " SITE etab1 | " |
|
||||
# " +-----------------+ " |
|
||||
# " | VM DNS | "-----------+
|
||||
# " | dns.cadoles.com | "
|
||||
# " +-----------------+ "
|
||||
# " "
|
||||
# + = = = = = = = = = = = = = = = = = = = = = = = = = = = +
|
||||
#
|
||||
set -xe
|
||||
|
||||
verif() {
|
||||
@ -12,22 +36,22 @@ verif() {
|
||||
}
|
||||
|
||||
# Import EOLE
|
||||
./script/cucchiaiata setting.source.create -o eole -u http://localhost
|
||||
./script/cucchiaiata setting.source.release.create -o eole -r 2.7.1.1 -e last
|
||||
./script/cucchiaiata setting.applicationservice.dataset.updated -o eole -e last
|
||||
./script/cucchiaiata setting.servermodel.dataset.updated -o eole -e last
|
||||
./script/cucchiaiata setting.source.create -o cadoles -u http://localhost
|
||||
./script/cucchiaiata setting.source.release.create -o cadoles -r 2020.1.1 -e last
|
||||
./script/cucchiaiata setting.applicationservice.dataset.updated -o cadoles -e last
|
||||
./script/cucchiaiata setting.servermodel.dataset.updated -o cadoles -e last
|
||||
|
||||
# Create a new user and set role 'server_rw' for this server
|
||||
./script/cucchiaiata user.user.create -u gnunux -n gnunux -s gnunux
|
||||
./script/cucchiaiata user.role.create -u gnunux -o 'server_rw' -a 'Server.ServerName' -v test.cadoles.com
|
||||
./script/cucchiaiata user.role.create -u gnunux -o 'server_rw' -a 'Server.ServerName' -v dns.cadoles.com
|
||||
|
||||
# A servermodel for node in cluster
|
||||
./script/cucchiaiata setting.servermodel.create -m cluster -d "Node in the cluster" -p base -o eole -e last
|
||||
./script/cucchiaiata setting.servermodel.create -m cluster -d "Node in the cluster" -p base -o cadoles -e last
|
||||
|
||||
# Heritage
|
||||
## ACA
|
||||
./script/cucchiaiata setting.servermodel.create -m aca -d Aca -p base -o eole -e last
|
||||
./script/cucchiaiata setting.applicationservice.dependency.add -n local_aca -a unbound -o eole -e last
|
||||
./script/cucchiaiata setting.servermodel.create -m aca -d Aca -p base -o cadoles -e last
|
||||
./script/cucchiaiata setting.servermodel.dependency.add -m aca -a unbound -o cadoles -e last
|
||||
S=$(./script/cucchiaiata setting.session.servermodel.start -m aca | jq -r .session_id)
|
||||
verif servermodel null null [] null
|
||||
./script/cucchiaiata setting.session.servermodel.configure -s $S --creole.reseau.unbound_route_address 192.168.1.2
|
||||
@ -38,13 +62,13 @@ verif servermodel 192.168.1.2 null [] null
|
||||
## etab1
|
||||
./script/cucchiaiata setting.servermodel.create -m etab1 -d "Etab 1" -p aca -o internal -e last
|
||||
S=$(./script/cucchiaiata setting.session.servermodel.start -m etab1 | jq -r .session_id)
|
||||
./script/cucchiaiata setting.session.servermodel.configure -s $S --creole.reseau.unbound_domain_name test.cadoles.com
|
||||
verif servermodel 192.168.1.2 test.cadoles.com [] null
|
||||
./script/cucchiaiata setting.session.servermodel.configure -s $S --creole.reseau.unbound_domain_name dns.cadoles.com
|
||||
verif servermodel 192.168.1.2 dns.cadoles.com [] null
|
||||
./script/cucchiaiata setting.session.servermodel.stop -s $S -a
|
||||
|
||||
## unbound
|
||||
./script/cucchiaiata setting.servermodel.create -m unbound -d "generic unbound configuration" -p base -o eole -e last
|
||||
./script/cucchiaiata setting.applicationservice.dependency.add -n local_unbound -a unbound -o eole -e last
|
||||
./script/cucchiaiata setting.servermodel.create -m unbound -d "generic unbound configuration" -p fedora-31 -o cadoles -e last
|
||||
./script/cucchiaiata setting.servermodel.dependency.add -m unbound -a unbound -o cadoles -e last
|
||||
S=$(./script/cucchiaiata setting.session.servermodel.start -m unbound | jq -r .session_id)
|
||||
./script/cucchiaiata setting.session.servermodel.configure -s $S --creole.serveur_dns.unbound_local_zones cadoles.com
|
||||
./script/cucchiaiata setting.session.servermodel.filter -s $S -n unbound
|
||||
@ -59,7 +83,7 @@ verif servermodel null null '["cadoles.com"]' null
|
||||
## unbound_etab1
|
||||
./script/cucchiaiata setting.servermodel.create -m unbound_etab1 -d "unbound configuration for etab1" -p etab1 unbound -o internal -e last
|
||||
S=$(./script/cucchiaiata setting.session.servermodel.start -m unbound_etab1 | jq -r .session_id)
|
||||
verif servermodel 192.168.1.2 test.cadoles.com '["cadoles.com"]' null
|
||||
verif servermodel 192.168.1.2 dns.cadoles.com '["cadoles.com"]' null
|
||||
|
||||
# Create a site, a zone and servers
|
||||
./script/cucchiaiata infra.site.create -i etab1 -d "Etab 1"
|
||||
@ -67,27 +91,27 @@ verif servermodel 192.168.1.2 test.cadoles.com '["cadoles.com"]' null
|
||||
./script/cucchiaiata infra.zone.create -z pedago -d "Pedago" -s etab1 cluster -n "192.168.1.0/24" -t "192.168.1.10" -e "192.168.1.100" -q 192.168.1.1 -g 192.168.1.254
|
||||
|
||||
./script/cucchiaiata infra.server.create -s node1.cadoles.com -d node1 -m cluster -e last -i cluster -z pedago
|
||||
./script/cucchiaiata infra.server.create -s test.cadoles.com -d description -m unbound_etab1 -e last -i etab1 -z pedago
|
||||
./script/cucchiaiata infra.server.create -s dns.cadoles.com -d description -m unbound_etab1 -e last -i etab1 -z pedago
|
||||
|
||||
# Create a cluster with one node and one VM
|
||||
./script/cucchiaiata provider.factory.cluster.create -c cluster.cadoles.com -d toto -v 192.168.1.1 -z pedago
|
||||
./script/cucchiaiata provider.factory.cluster.join -c cluster.cadoles.com -n node1.cadoles.com
|
||||
./script/cucchiaiata provider.factory.server.add -s test.cadoles.com -c cluster.cadoles.com -p 0.2 -v 2 -m 2
|
||||
./script/cucchiaiata provider.factory.server.add -s dns.cadoles.com -n node1.cadoles.com -p 0.2 -v 2 -m 2
|
||||
|
||||
# Configure server
|
||||
S=$(./script/cucchiaiata setting.session.server.start -s test.cadoles.com | jq -r .session_id)
|
||||
S=$(./script/cucchiaiata setting.session.server.start -s dns.cadoles.com | jq -r .session_id)
|
||||
./script/cucchiaiata setting.session.server.configure -s $S --creole.reseau.unbound_ip_address_cidr 192.168.1.1/24
|
||||
./script/cucchiaiata setting.session.server.validate -s $S
|
||||
verif server 192.168.1.2 test.cadoles.com '["cadoles.com"]' 192.168.1.1/24
|
||||
verif server 192.168.1.2 dns.cadoles.com '["cadoles.com"]' 192.168.1.1/24
|
||||
./script/cucchiaiata setting.session.server.stop -s $S -a
|
||||
|
||||
# Generate configuration
|
||||
./script/cucchiaiata setting.config.configuration.server.deploy -s test.cadoles.com
|
||||
./script/cucchiaiata setting.template.generate -s test.cadoles.com
|
||||
./script/cucchiaiata setting.config.configuration.server.deploy -s dns.cadoles.com
|
||||
./script/cucchiaiata setting.template.generate -s dns.cadoles.com
|
||||
|
||||
# Add OpenSSH dependency
|
||||
./script/cucchiaiata setting.applicationservice.dependency.add -n local_aca -a openssh -o eole -e last
|
||||
S=$(./script/cucchiaiata setting.session.server.start -s test.cadoles.com | jq -r .session_id)
|
||||
./script/cucchiaiata setting.servermodel.dependency.add -m aca -a openssh -o cadoles -e last
|
||||
S=$(./script/cucchiaiata setting.session.server.start -s dns.cadoles.com | jq -r .session_id)
|
||||
R=$(./script/cucchiaiata setting.session.server.get -s $S -n creole.serveur_ssh.ssh_allow_networks | jq -Mcr .content[])
|
||||
[ $R = "[]" ]
|
||||
./script/cucchiaiata setting.session.server.stop -s $S
|
||||
@ -96,13 +120,16 @@ S=$(./script/cucchiaiata setting.session.servermodel.start -m aca | jq -r .sessi
|
||||
./script/cucchiaiata setting.session.servermodel.configure -s $S --creole.serveur_ssh.ssh_allow_networks admin.cadoles.com
|
||||
./script/cucchiaiata setting.session.servermodel.stop -s $S -a
|
||||
|
||||
S=$(./script/cucchiaiata setting.session.server.start -s test.cadoles.com | jq -r .session_id)
|
||||
S=$(./script/cucchiaiata setting.session.server.start -s dns.cadoles.com | jq -r .session_id)
|
||||
R=$(./script/cucchiaiata setting.session.server.get -s $S -n creole.serveur_ssh.ssh_allow_networks | jq -Mcr .content[])
|
||||
[ $R = '["admin.cadoles.com"]' ]
|
||||
./script/cucchiaiata setting.session.server.stop -s $S
|
||||
|
||||
# Regenerate configuration
|
||||
./script/cucchiaiata setting.config.configuration.server.deploy -s test.cadoles.com
|
||||
./script/cucchiaiata setting.template.generate -s test.cadoles.com
|
||||
./script/cucchiaiata setting.config.configuration.server.deploy -s dns.cadoles.com
|
||||
./script/cucchiaiata setting.template.generate -s dns.cadoles.com
|
||||
|
||||
# Generate cluster's configurtion
|
||||
./script/cucchiaiata provider.factory.configure -c cluster.cadoles.com
|
||||
|
||||
echo "fin"
|
||||
|
Loading…
Reference in New Issue
Block a user