Compare commits
23 Commits
dist/eole/
...
pkg/dev/ri
Author | SHA1 | Date | |
---|---|---|---|
5e796f17d2 | |||
408fdf22a2 | |||
f13e0b8555 | |||
940a76698f | |||
9540ff6c8f | |||
7becbca64e | |||
54c895f822 | |||
f371c96ff3 | |||
0d938a2389 | |||
1873722043 | |||
2dce20e691 | |||
66f83826e0 | |||
2c9b78ee14 | |||
ccd30b7ab5 | |||
d7af784926 | |||
80bcc8821f | |||
71bbc42786 | |||
a69d0f7386 | |||
93db38dc7f | |||
2ce388eaf9 | |||
138d6d9e06 | |||
68add009e2 | |||
761c112ad4 |
@ -1,151 +0,0 @@
|
||||
-- Deployment
|
||||
CREATE TABLE Deployment (
|
||||
DeploymentId SERIAL PRIMARY KEY,
|
||||
ProviderType VARCHAR(255) NOT NULL,
|
||||
TargetType VARCHAR(255) NOT NULL,
|
||||
TargetName VARCHAR(255) NOT NULL,
|
||||
FactoryCluster VARCHAR(255),
|
||||
FactoryNodeName VARCHAR(255),
|
||||
CPU INTEGER,
|
||||
VCPU INTEGER,
|
||||
Memory INTEGER,
|
||||
Labels VARCHAR(255) [] DEFAULT '{}',
|
||||
UNIQUE (TargetType, TargetName)
|
||||
);
|
||||
CREATE INDEX Deployment_FactoryNodeName_index ON Deployment(FactoryNodeName);
|
||||
|
||||
-- Cluster
|
||||
CREATE TABLE FactoryCluster (
|
||||
ClusterId SERIAL PRIMARY KEY,
|
||||
ClusterName VARCHAR(255) NOT NULL UNIQUE,
|
||||
ClusterDescription VARCHAR(255) NOT NULL,
|
||||
VirtualIp VARCHAR(15) NOT NULL,
|
||||
ZoneName VARCHAR(255) NOT NULL
|
||||
);
|
||||
|
||||
-- Node in Cluster
|
||||
CREATE TABLE FactoryClusterNode (
|
||||
ClusterNodeId SERIAL PRIMARY KEY,
|
||||
ClusterId INTEGER NOT NULL,
|
||||
ServerName VARCHAR(255) NOT NULL UNIQUE,
|
||||
FOREIGN KEY (ClusterId) REFERENCES FactoryCluster(ClusterId)
|
||||
);
|
||||
CREATE INDEX FactoryClusterNode_ServerName_index ON FactoryClusterNode(ServerName);
|
||||
-- Site
|
||||
CREATE TABLE Site (
|
||||
SiteId SERIAL PRIMARY KEY,
|
||||
SiteName VARCHAR(255) NOT NULL UNIQUE,
|
||||
SiteDescription VARCHAR(255) NOT NULL
|
||||
);
|
||||
|
||||
-- Zone
|
||||
CREATE TABLE Zone (
|
||||
ZoneId SERIAL PRIMARY KEY,
|
||||
ZoneName VARCHAR(255) NOT NULL UNIQUE,
|
||||
ZoneDescription VARCHAR(255) NOT NULL,
|
||||
SitesName VARCHAR(255) [] NOT NULL
|
||||
);
|
||||
|
||||
-- Server
|
||||
CREATE TABLE Server (
|
||||
ServerId SERIAL PRIMARY KEY,
|
||||
ServerName VARCHAR(255) NOT NULL UNIQUE,
|
||||
ServerDescription VARCHAR(255) NOT NULL,
|
||||
ServerServermodelName VARCHAR(255) NOT NULL,
|
||||
ReleaseDistribution VARCHAR(255) NOT NULL,
|
||||
SiteName VARCHAR(255) NOT NULL,
|
||||
ZonesName VARCHAR(255) [] NOT NULL,
|
||||
ZonesIP VARCHAR(255) [] NOT NULL
|
||||
);
|
||||
-- Source
|
||||
CREATE TABLE Source (
|
||||
SourceId SERIAL PRIMARY KEY,
|
||||
SourceName VARCHAR(255) NOT NULL UNIQUE,
|
||||
SourceURL TEXT
|
||||
);
|
||||
|
||||
-- Release
|
||||
CREATE TABLE Release (
|
||||
ReleaseId SERIAL PRIMARY KEY,
|
||||
ReleaseName VARCHAR(255) NOT NULL,
|
||||
ReleaseSourceId INTEGER NOT NULL,
|
||||
ReleaseDistribution VARCHAR(20) CONSTRAINT releasedistribution_choice CHECK (ReleaseDistribution IN ('last', 'n-1', 'n-2')),
|
||||
UNIQUE (ReleaseName, ReleaseSourceId),
|
||||
UNIQUE (ReleaseDistribution, ReleaseSourceId),
|
||||
FOREIGN KEY (ReleaseSourceId) REFERENCES Source(SourceId)
|
||||
);
|
||||
|
||||
-- Servermodel
|
||||
CREATE TABLE Servermodel (
|
||||
ServermodelId SERIAL PRIMARY KEY,
|
||||
ServermodelName VARCHAR(255) NOT NULL,
|
||||
ServermodelDescription VARCHAR(255) NOT NULL,
|
||||
Osname VARCHAR(255),
|
||||
Osversion VARCHAR(255),
|
||||
ISO VARCHAR(255),
|
||||
ServermodelParents VARCHAR(255) [] DEFAULT '{}',
|
||||
SourceName VARCHAR(255) NOT NULL,
|
||||
ReleaseDistribution VARCHAR(255) NOT NULL,
|
||||
ServermodelApplicationserviceId INTEGER NOT NULL,
|
||||
UNIQUE (ServermodelName, SourceName, ReleaseDistribution)
|
||||
);
|
||||
CREATE INDEX ServermodelApplicationserviceId_index ON Servermodel (ServermodelApplicationserviceId);
|
||||
|
||||
-- Applicationservice
|
||||
CREATE TABLE Applicationservice (
|
||||
ApplicationserviceId SERIAL PRIMARY KEY,
|
||||
ApplicationserviceName VARCHAR(255) NOT NULL,
|
||||
ApplicationserviceDescription VARCHAR(255) NOT NULL,
|
||||
ApplicationserviceReleaseId INTEGER NOT NULL,
|
||||
ApplicationserviceLVIS VARCHAR(255) NOT NULL,
|
||||
ApplicationserviceLVIP VARCHAR(255) NOT NULL,
|
||||
ApplicationserviceLVMP VARCHAR(255) NOT NULL,
|
||||
OS JSON,
|
||||
UNIQUE (ApplicationserviceName, ApplicationserviceReleaseId)
|
||||
);
|
||||
|
||||
CREATE TABLE ApplicationserviceDependency (
|
||||
ApplicationserviceId INTEGER NOT NULL,
|
||||
ApplicationserviceDependencyId INTEGER NOT NULL,
|
||||
UNIQUE(ApplicationserviceId, ApplicationserviceDependencyId),
|
||||
FOREIGN KEY (ApplicationserviceId) REFERENCES Applicationservice(ApplicationserviceId),
|
||||
FOREIGN KEY (ApplicationserviceDependencyId) REFERENCES Applicationservice(ApplicationserviceId)
|
||||
);
|
||||
|
||||
-- Log
|
||||
CREATE TABLE log(
|
||||
Msg VARCHAR(255) NOT NULL,
|
||||
Level VARCHAR(10) NOT NULL,
|
||||
Path VARCHAR(255),
|
||||
Username VARCHAR(100) NOT NULL,
|
||||
Data JSON,
|
||||
Date timestamp DEFAULT current_timestamp
|
||||
);
|
||||
-- User, Role and ACL
|
||||
CREATE TABLE RisottoUser (
|
||||
UserId SERIAL PRIMARY KEY,
|
||||
UserLogin VARCHAR(100) NOT NULL UNIQUE,
|
||||
UserName VARCHAR(100) NOT NULL,
|
||||
UserSurname VARCHAR(100) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE UserRole (
|
||||
RoleId SERIAL PRIMARY KEY,
|
||||
RoleUserId INTEGER NOT NULL,
|
||||
RoleName VARCHAR(255) NOT NULL,
|
||||
RoleAttribute VARCHAR(255),
|
||||
RoleAttributeValue VARCHAR(255),
|
||||
FOREIGN KEY (RoleUserId) REFERENCES RisottoUser(UserId)
|
||||
);
|
||||
|
||||
CREATE TABLE URI (
|
||||
URIId SERIAL PRIMARY KEY,
|
||||
URIName VARCHAR(255) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
CREATE TABLE RoleURI (
|
||||
RoleName VARCHAR(255) NOT NULL,
|
||||
URIId INTEGER NOT NULL,
|
||||
FOREIGN KEY (URIId) REFERENCES URI(URIId),
|
||||
PRIMARY KEY (RoleName, URIId)
|
||||
);
|
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,5 +0,0 @@
|
||||
eole-risotto (0.1-1) unstable; urgency=medium
|
||||
|
||||
* Création du paquet
|
||||
|
||||
-- Cadoles <contact@cadoles.com> Thu, 02 Apr 2020 10:43:03 +0200
|
25
debian/control
vendored
25
debian/control
vendored
@ -10,9 +10,32 @@ Vcs-Browser: https://forge.cadoles.com/Infra/risotto
|
||||
|
||||
Package: eole-risotto
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends},
|
||||
Depends: ${misc:Depends},
|
||||
eole-db,
|
||||
eole-postgresql,
|
||||
risotto-user-sql,
|
||||
risotto-setting-sql,
|
||||
risotto-provider-sql,
|
||||
risotto-infra-sql,
|
||||
risotto-message,
|
||||
risotto
|
||||
Description: configuration pour l’intégration de risotto dans EOLE
|
||||
.
|
||||
Pour toute information complémentaire, veuillez vous rendre sur le
|
||||
site du projet.
|
||||
|
||||
Package: eole-risotto-all
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends},
|
||||
eole-risotto,
|
||||
python3-risotto-user,
|
||||
python3-risotto-setting,
|
||||
python3-risotto-provider,
|
||||
python3-risotto-infra,
|
||||
cadoles-risotto-seed,
|
||||
cucchiaiata,
|
||||
eole-risotto
|
||||
Description: configuration pour l’intégration de risotto dans EOLE
|
||||
.
|
||||
Pour toute information complémentaire, veuillez vous rendre sur le
|
||||
site du projet.
|
||||
|
35
dicos/20_partitioning_risotto.xml
Normal file
35
dicos/20_partitioning_risotto.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<creole>
|
||||
<variables>
|
||||
<family name='système'>
|
||||
<!-- We need to recalculate the variables -->
|
||||
<variable name='eole_lv_names' redefine='True' remove_check='True' />
|
||||
<variable name='eole_lv_standard_extends' redefine='True' remove_check='True' />
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<!-- Default AmonEcole* logical volumes -->
|
||||
<auto name='calc_multi_val' target='eole_lv_names'>
|
||||
<param>root</param>
|
||||
<param>tmp</param>
|
||||
<param>var</param>
|
||||
<param>var+spool</param>
|
||||
<param>var+log</param>
|
||||
<param>home</param>
|
||||
</auto>
|
||||
<!-- Default AmonEcole* logical volumes extension: 100% /home -->
|
||||
<auto name='calc_multi_val' target='eole_lv_standard_extends'>
|
||||
<param type='number'>0</param>
|
||||
<param type='number'>0</param>
|
||||
<param type='number'>0</param>
|
||||
<param type='number'>0</param>
|
||||
<param type='number'>0</param>
|
||||
<param type='number'>100</param>
|
||||
</auto>
|
||||
</constraints>
|
||||
<help/>
|
||||
</creole>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
systemctl start postgresql.service
|
||||
|
||||
psql -Upostgres -c "grant all on all tables in schema public to risotto" risotto
|
||||
psql -Upostgres -c "grant all on all sequences in schema public to risotto" risotto
|
||||
psql -Upostgres -c "grant all on all functions in schema public to risotto" risotto
|
||||
@ -9,4 +11,6 @@ psql -Upostgres -c "grant all on all tables in schema public to tiramisu" tirami
|
||||
psql -Upostgres -c "grant all on all sequences in schema public to tiramisu" tiramisu
|
||||
psql -Upostgres -c "grant all on all functions in schema public to tiramisu" tiramisu
|
||||
|
||||
systemctl stop postgresql.service
|
||||
|
||||
exit 0
|
@ -1,17 +1,23 @@
|
||||
%from os import listdir
|
||||
%set %%dbname = %%getVar('risotto_main_dbname')
|
||||
---
|
||||
dbuser: %%getVar('risotto_db_user')
|
||||
dbuser_options:
|
||||
- LOGIN
|
||||
- LOGIN
|
||||
privileges:
|
||||
%%{dbname}.public.*: 'ALL'
|
||||
%%{dbname}.public: 'ALL'
|
||||
%%{dbname}: 'ALL'
|
||||
%%{dbname}.public.*: 'ALL'
|
||||
%%{dbname}.public: 'ALL'
|
||||
%%{dbname}: 'ALL'
|
||||
dbhost: %%getVar('risotto_db_address')
|
||||
dbport: 5432
|
||||
dbtype: postgres
|
||||
dbname: %%dbname
|
||||
template: 'template0'
|
||||
sqlscripts: ['/usr/share/eole/db/eole-risotto/gen/create_tables.sql']
|
||||
sqlscripts:
|
||||
%for %%file in %%listdir('/usr/share/eole/db/eole-risotto/gen/')
|
||||
%if %%file.endswith('.sql')
|
||||
- /usr/share/eole/db/eole-risotto/gen/%%file
|
||||
%end if
|
||||
%end for
|
||||
pwd_files:
|
||||
- {'file': '/etc/risotto/risotto.conf', 'pattern': 'RISOTTO_DB_PASSWORD='}
|
||||
- {'file': '/etc/risotto/risotto.conf', 'pattern': 'RISOTTO_DB_PASSWORD='}
|
||||
|
Reference in New Issue
Block a user