Skip to content

Add missing bits re. initial setup to refactored README #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,28 @@ You will also need to install [OpenTofu](https://opentofu.org/docs/intro/install

### Create a new environment

Use the `cookiecutter` template to create a new environment to hold your configuration. In the repository root run:
Run the following from the repository root to activate the venv:

. venv/bin/activate

Use the `cookiecutter` template to create a new environment to hold your configuration:

cd environments
cookiecutter skeleton

and follow the prompts to complete the environment name and description.

**NB:** In subsequent sections this new environment is refered to as `$ENV`.

Now generate secrets for this environment:
Activate the new environment:

. environments/$ENV/activate

And generate secrets for it:

ansible-playbook ansible/adhoc/generate-passwords.yml

### Define infrastructure configuration
### Define and deploy infrastructure

Create an OpenTofu variables file to define the required infrastructure, e.g.:

Expand All @@ -91,20 +98,28 @@ Create an OpenTofu variables file to define the required infrastructure, e.g.:
}
}

Variables marked `*` refer to OpenStack resources which must already exist. The above is a minimal configuration - for all variables
and descriptions see `environments/$ENV/terraform/terraform.tfvars`.
Variables marked `*` refer to OpenStack resources which must already exist. The above is a minimal configuration - for all variables and descriptions see `environments/$ENV/terraform/terraform.tfvars`.

To deploy this infrastructure, ensure the venv and the environment are [activated](#create-a-new-environment) and run:

### Deploy appliance
export OS_CLOUD=openstack
cd environments/$ENV/terraform/
tofu apply

and follow the prompts. Note the OS_CLOUD environment variable assumes that OpenStack credentials are defined using a [clouds.yaml](https://docs.openstack.org/python-openstackclient/latest/configuration/index.html#clouds-yaml) file in a default location with the default cloud name of `openstack`.

### Configure appliance

To configure the appliance, ensure the venv and the environment are [activated](#create-a-new-environment) and run:

ansible-playbook ansible/site.yml

You can now log in to the cluster using:
Once it completes you can log in to the cluster using:

ssh rocky@$login_ip

where the IP of the login node is given in `environments/$ENV/inventory/hosts.yml`


## Overview of directory structure

- `environments/`: See [docs/environments.md](docs/environments.md).
Expand Down