MAAS: Difference between revisions
Jump to navigation
Jump to search
Line 25: | Line 25: | ||
===Schema=== | ===Schema=== | ||
---- | ---- | ||
<source lang="sql"> | <source lang="sql"> | ||
sudo -i -u postgres psql << DDL | sudo -i -u postgres psql << DDL | ||
Line 47: | Line 41: | ||
host ${MAAS_DBNAME:-academia_maas} ${MAAS_DBUSER:-academia_maas} 0/0 md5 | host ${MAAS_DBNAME:-academia_maas} ${MAAS_DBUSER:-academia_maas} 0/0 md5 | ||
EOF | EOF | ||
</source> | |||
==Configuration== | |||
<source lang="bash"> | |||
sudo maas init region+rack --database-uri "postgres://${MAAS_DBUSER:-academia_maas}:${MAAS_DBPASS:-sadaqah}@${MAAS_DBHOST:-localhost}/${MAAS_DBNAME:-academia_maas}" | |||
</source> | </source> | ||
Revision as of 02:04, 17 March 2023
sudo snap install maas --channel=3.3/stable sudo snap install maas
PostgreSQL
Install
sudo apt install postgresql postgresql-contrib
sudo systemctl enable postgresql
sudo systemctl status postgresql
sudo systemctl start postgresql
sudo systemctl daemon-reload
sudo -i -u postgres bash << EOF
createuser ${USER}
createdb ${USER}
cat << DDL | psql
ALTER USER ${USER} WITH SUPERUSER;
DDL
EOF
Schema
sudo -i -u postgres psql << DDL
CREATE USER ${MAAS_DBUSER:-academia_maas} WITH ENCRYPTED PASSWORD '${MAAS_DBPASS:-sadaqah}'
DDL
sudo -i -u postgres bash << EOF
createdb --owner ${MAAS_DBUSER:-academia_maas} ${MAAS_DBNAME:-academia_maas}
EOF
cat << EOF | sudo tee -a /etc/postgresql/14/main/pg_hba.conf >/dev/null
host ${MAAS_DBNAME:-academia_maas} ${MAAS_DBUSER:-academia_maas} 0/0 md5
EOF
Configuration
sudo maas init region+rack --database-uri "postgres://${MAAS_DBUSER:-academia_maas}:${MAAS_DBPASS:-sadaqah}@${MAAS_DBHOST:-localhost}/${MAAS_DBNAME:-academia_maas}"
Knowledge
install: sudo snap install maas --channel=3.3 |
upgrade: sudo snap refresh maas --channel=3.3 |
sudo snap install maas-test-db sudo maas-test-db.psql |
| ||
sudo maas init --help |
References
| ||