added config and updated readme

This commit is contained in:
cpu
2024-01-27 19:10:03 +01:00
parent c9d6341a55
commit 050ce57094
3 changed files with 17 additions and 18 deletions

View File

@@ -11,19 +11,19 @@ You will require a host with LXD and you will also require to initialize the hos
```bash
sudo snap install lxd
lxd init --minimal
lxc config set core.https_address IP_ADDRESS:8443
lxc config set core.https_address LXD_HOST_IP_ADDRESS:8443
lxc config set core.trust_password A-SECURE-LXD-PASSWORD
sudo ufw allow in on lan to IP_ADDRESS port 8443 proto tcp
sudo ufw allow in on wg0 to IP_ADDRESS port 8443 proto tcp
sudo ufw allow in on lan to LXD_HOST_IP_ADDRESS port 8443 proto tcp
sudo ufw allow in on wg0 to LXD_HOST_IP_ADDRESS port 8443 proto tcp
```
## Setup the client machine e.g. a notebook
```bash
sudo snap install lxd
lxc remote add zot IP_ADDRESS
lxc remote switch zot
lxc remote add zot LXD_HOST_IP_ADDRESS
lxc remote switch zot # make the zot the default
lxc remote list
lxc list # shows instances running on the server zot
lxc list # shows instances running on the remote zot
lxc shell ubuntu # login as root to the container ubuntu
lxc exec ubuntu -- uname -a # run a command inside the container ubuntu
```
@@ -37,7 +37,7 @@ Then provision a lxd instance and a zfs storage pool with terraform:
```bash
terraform init
terraform plan
terraform apply
terraform apply -auto-approve
Outputs:
@@ -61,7 +61,7 @@ See the config
Delete the container ubuntu using terraform
`terraform destroy --target lxd_instance.ubuntu`
`terraform destroy --target lxd_instance.ubuntu -auto-approve`
## SSH Config
@@ -75,12 +75,5 @@ Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.4.0-122-generic x86_64)
john@ubuntu:~$
```
Or as ubuntu using a private key. The public key is set in the variable `ssh_pub_key` in file `terraform.tfvars`
```bash
$ ssh -i .ssh/id_ed25519 ubuntu@ubuntu.lxd
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.4.0-122-generic x86_64)
ubuntu@ubuntu:~$
```
## If groups have changed in the LDAP cache must be invalidated. Flush nscd groups cache
## If groups have changed in the LDAP the cache must be invalidated. Flush nscd groups cache
`sudo nscd --invalidate=group`