MAAS: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
sudo snap install maas --channel=3.3/stable
<source lang="bash">
  sudo snap install maas
sudo snap install maas --channel=3.3/stable
sudo snap install maas
 
MAAS_DBUSER='academia_maas'
MAAS_DBNAME='academia_maas'
MAAS_DBHOST='localhost'
MAAS_DBPASS='sadaqah!'
</source>
 
==PostgreSQL==
===Install===
----
<source lang="bash">
sudo apt install postgresql postgresql-contrib
sudo systemctl enable postgresql
sudo systemctl status postgresql
sudo systemctl start  postgresql
sudo systemctl daemon-reload
</source>
 
<source lang="bash">
sudo -i -u postgres bash << EOF
createuser ${USER}
createdb  ${USER}
cat << DDL | psql
ALTER USER ${USER} WITH SUPERUSER;
DDL
EOF
</source>
 
===Schema===
----
<source lang="sql">
sudo -i -u postgres psql << DDL
CREATE USER ${MAAS_DBUSER:-academia_maas} WITH ENCRYPTED PASSWORD '${MAAS_DBPASS:-sadaqah}'
DDL
</source>
 
<source lang="bash">
sudo -i -u postgres bash << EOF
createdb --owner ${MAAS_DBUSER:-academia_maas} ${MAAS_DBNAME:-academia_maas}
EOF
</source>
 
<source lang="bash">
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
</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}"
:'
MAAS URL [default=http://10.19.83.11:5240/MAAS]:
MAAS has been set up.
 
If you want to configure external authentication or use
MAAS with Canonical RBAC, please run
  sudo maas configauth
 
To create admins when not using external authentication, run
  sudo maas createadmin
 
To enable TLS for secured communication, please run
  sudo maas config-tls enable
'
</source>
 
==Knowledge==
{|
|valign="top"|
'''install:'''
  sudo snap install maas --channel=3.3
 
|valign="top"|
'''upgrade:'''
sudo snap refresh maas --channel=3.3
 
|valign="top"|
sudo snap install maas-test-db
sudo maas-test-db.psql
 
|-
|colspan="3"|
----
|-
| valign="top" |
sudo snap stop maas
sudo snap disable maas
 
| valign="top" |
sudo maas init --help
 
| valign="top" |
 
|}


==References==
==References==
Line 9: Line 106:
* [[Linux Containers]]
* [[Linux Containers]]
* [https://snapcraft.io/maas MAAS » Install]
* [https://snapcraft.io/maas MAAS » Install]
* [[PostgreSQL]]
* [[Minikube]]
* [[Minikube]]
* [[Podman]]
* [[Podman]]
* [[Ansible]]
* [[Docker]]
* [[Docker]]
* [[JQ Tool]]
* [[JQ Tool]]
Line 17: Line 114:


| valign="top" |
| valign="top" |
* [https://unix.stackexchange.com/questions/122845/ Using <code>${a:-b}</code> for a Bash Variable Assignment]
* [https://unix.stackexchange.com/questions/594841/ Assign a Default Value to a Bash Variable]
* [[Academia JavaEE Workspace in Raspbian]]
* [[Academia JavaEE Workspace in Ubuntu]]
* [[Academia JavaEE Workspace in MacOS]]
* [[Terraform]]
* [[Ansible]]
* [[TMux]]
* [[Ceph]]
* [[Juju]]


| valign="top" |
| valign="top" |
* [https://snapcraft.io/docs/service-management Snap » Service management]
* [[Multipass]]
* [[Proxmox]]


|-
|-

Latest revision as of 23:15, 28 November 2023

sudo snap install maas --channel=3.3/stable
sudo snap install maas

MAAS_DBUSER='academia_maas'
MAAS_DBNAME='academia_maas'
MAAS_DBHOST='localhost'
MAAS_DBPASS='sadaqah!'

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}"
:'
MAAS URL [default=http://10.19.83.11:5240/MAAS]:
MAAS has been set up.

If you want to configure external authentication or use
MAAS with Canonical RBAC, please run
  sudo maas configauth

To create admins when not using external authentication, run
  sudo maas createadmin

To enable TLS for secured communication, please run
  sudo maas config-tls enable
'

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 snap stop maas
sudo snap disable maas
sudo maas init --help

References