Skip to content

Commit 4c0e084

Browse files
committed
Updated docs for new environment structure
1 parent 4dc2421 commit 4c0e084

File tree

16 files changed

+33
-68
lines changed

16 files changed

+33
-68
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Run the following from the repository root to activate the venv:
6161
Use the `cookiecutter` template to create a new environment to hold your configuration:
6262

6363
cd environments
64-
cookiecutter skeleton
64+
cookiecutter ../cookiecutter
6565

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

ansible/roles/alertmanager/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ Note that:
1111
- No Grafana dashboard for alerts is currently provided.
1212

1313
Alertmanager is enabled by default on the `control` node in the
14-
[everything](../../../environments/common/layouts/everything) template which
15-
`cookiecutter` uses for a new environment's `inventory/groups` file.
14+
`site` environment's `inventory/groups` file.
1615

1716
In general usage may only require:
18-
- Adding the `control` node into the `alertmanager` group in `environments/site/groups`
19-
if upgrading an existing environment.
2017
- Enabling the Slack integration (see section below).
2118
- Possibly setting `alertmanager_web_external_url`.
2219

ansible/roles/block_devices/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is a convenience wrapper around the ansible modules:
1111

1212
To avoid issues with device names changing after e.g. reboots, devices are identified by serial number and mounted by filesystem UUID.
1313

14-
**NB:** This role is ignored[^1] during Packer builds as block devices will not be attached to the Packer build VMs. This role is therefore deprecated and it is suggested that `cloud-init` is used instead. See e.g. `environments/skeleton/{{cookiecutter.environment}}/tofu/control.userdata.tpl`.
14+
**NB:** This role is ignored[^1] during Packer builds as block devices will not be attached to the Packer build VMs. This role is therefore deprecated and it is suggested that `cloud-init` is used instead. See e.g. `environments/site/tofu/control.userdata.tpl`.
1515

1616
[^1]: See `environments/common/inventory/group_vars/builder/defaults.yml`
1717

ansible/roles/freeipa/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Support FreeIPA in the appliance. In production use it is expected the FreeIPA s
77

88
## Usage
99
- Add hosts to the `freeipa_client` group and run (at a minimum) the `ansible/iam.yml` playbook.
10-
- Host names must match the domain name. By default (using the skeleton OpenTofu) hostnames are of the form `nodename.cluster_name.cluster_domain_suffix` where `cluster_name` and `cluster_domain_suffix` are OpenTofu variables.
10+
- Host names must match the domain name. By default (using the site OpenTofu) hostnames are of the form `nodename.cluster_name.cluster_domain_suffix` where `cluster_name` and `cluster_domain_suffix` are OpenTofu variables.
1111
- Hosts discover the FreeIPA server FQDN (and their own domain) from DNS records. If DNS servers are not set this is not set from DHCP, then use the `resolv_conf` role to configure this. For example when using the in-appliance FreeIPA development server:
1212

1313
```ini
@@ -28,7 +28,7 @@ Support FreeIPA in the appliance. In production use it is expected the FreeIPA s
2828
- For production use with an external FreeIPA server, a random one-time password (OTP) must be generated when adding hosts to FreeIPA (e.g. using `ipa host-add --random ...`). This password should be set as a hostvar `freeipa_host_password`. Initial host enrolment will use this OTP to enrol the host. After this it becomes irrelevant so it does not need to be committed to git. This approach means the appliance does not require the FreeIPA administrator password.
2929
- For development use with the in-appliance FreeIPA server, `freeipa_host_password` will be automatically generated in memory.
3030
- The `control` host must define `appliances_state_dir` (on persistent storage). This is used to back-up keytabs to allow FreeIPA clients to automatically re-enrol after e.g. reimaging. Note that:
31-
- This is implemented when using the skeleton OpenTofu; on the control node `appliances_state_dir` defaults to `/var/lib/state` which is mounted from a volume.
31+
- This is implemented when using the site OpenTofu; on the control node `appliances_state_dir` defaults to `/var/lib/state` which is mounted from a volume.
3232
- Nodes are not re-enroled by a [Slurm-driven reimage](../../collections/ansible_collections/stackhpc/slurm_openstack_tools/roles/rebuild/README.md) (as that does not run this role).
3333
- If both a backed-up keytab and `freeipa_host_password` exist, the former is used.
3434

docs/adding-functionality.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Please contact us for specific advice, but this generally involves:
44
- Adding a role.
55
- Adding a play calling that role into an existing playbook in `ansible/`, or adding a new playbook there and updating `site.yml`.
6-
- Adding a new (empty) group named after the role into `environments/common/inventory/groups` and a non-empty example group into `environments/common/layouts/everything`.
6+
- Adding a new (empty) group named after the role into `environments/common/inventory/groups` and a non-empty example group into `environments/site/inventory/groups`.
77
- Adding new default group vars into `environments/common/inventory/group_vars/all/<rolename>/`.
88
- Updating the default Packer build variables in `environments/common/inventory/group_vars/builder/defaults.yml`.
99
- Updating READMEs.

docs/alerting.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ must be configured to generate notifications.
2121
## Enabling alertmanager
2222

2323
1. Ensure both the `prometheus` and `alertmanager` servers are deployed on the
24-
control node - for new environments the `cookiecutter` tool will have done
25-
this:
24+
control node - these are deployed by default in the site environment's groups:
2625

2726
```ini
2827
# environments/site/groups:

docs/experimental/isolated-clusters.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ access from all nodes, possibly via a [proxy](../../ansible/roles/proxy/).
66
However many features (as defined by Ansible inventory groups/roles) will work
77
if the cluster network(s) provide no outbound access. Currently this includes
88
all "default" features, i.e. roles/groups which are enabled either in the
9-
`common` environment or in the `environments/$ENV/inventory/groups` file
10-
created by cookiecutter for a new environment.
9+
`common` or `site` environments.
1110

1211
The full list of features and whether they are functional on such an "isolated"
1312
network is shown in the table below. Note that:

docs/monitoring-and-logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ The `prometheus` group determines the placement of the prometheus service. Load
227227

228228
### Access
229229

230-
Prometheus is exposed on port `9090` on all hosts in the prometheus group. Currently, the configuration assumes a single host. Following the reference layout in `environments/common/layouts/everything`, this will be set to the slurm `control` node, prometheus would then be accessible from:
230+
Prometheus is exposed on port `9090` on all hosts in the prometheus group. Currently, the configuration assumes a single host. Following the reference layout in `environments/site/inventory/groups`, this will be set to the slurm `control` node, prometheus would then be accessible from:
231231

232232
> http://<control_node_ip>:9090
233233

docs/persistent-state.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ At present this will affect the following:
99
- Grafana data
1010
- OpenDistro/elasticsearch data
1111

12-
If using the `environments/common/layout/everything` Ansible groups template (which is the default for a new cookiecutter-produced environment) then these services will all be on the `control` node and hence only this node requires persistent storage.
12+
If using the upstream defaults in the `site` environments `inventory/groups` file then these services will all be on the `control` node and hence only this node requires persistent storage.
1313

1414
Note that if `appliances_state_dir` is defined, the path it gives must exist and should be owned by root. Directories will be created within this with appropriate permissions for each item of state defined above. Additionally, the systemd units for the services listed above will be modified to require `appliances_state_dir` to be mounted before service start (via the `systemd` role).
1515

16-
A new cookiecutter-produced environment supports persistent state in the default OpenTofu (see `environments/skeleton/{{cookiecutter.environment}}/tofu/`) by:
16+
The `site` environment supports persistent state in the default OpenTofu (see `environments/site/tofu/`) by:
1717

1818
- Defining a volume with a default size of 150GB - this can be controlled by the OpenTofu variable `state_volume_size`.
1919
- Attaching it to the control node.

docs/production.md

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,15 @@ production-ready deployments.
77
- Get it agreed up front what the cluster names will be. Changing this later
88
requires instance deletion/recreation.
99

10-
- At least three environments should be created:
11-
- `site`: site-specific base environment
10+
- At least two environments should be created on top of the `site` base environment:
1211
- `production`: production environment
1312
- `staging`: staging environment
1413

1514
A `dev` environment should also be created if considered required, or this
1615
can be left until later.
1716

18-
These can all be produced using the cookicutter instructions, but the
19-
`production` and `staging` environments will need their
20-
`environments/$ENV/ansible.cfg` file modifying so that they point to the
21-
`site` environment:
22-
23-
```ini
24-
inventory = ../common/inventory,../site/inventory,inventory
25-
```
26-
27-
In general only the `site` environment will need an `inventory/groups` file -
28-
this is templated out by cookiecutter and should be modified as required to
17+
In general only the `inventory/groups` file in the `site` environment is needed -
18+
it can be modified as required to
2919
enable features for all environments at the site.
3020

3121
- To avoid divergence of configuration all possible overrides for group/role
@@ -42,34 +32,10 @@ and referenced from the `site` and `production` environments, e.g.:
4232
import_playbook: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}/../site/hooks/pre.yml"
4333
```
4434

45-
- OpenTofu configurations should be defined in the `site` environment and used
46-
as a module from the other environments. This can be done with the
47-
cookie-cutter generated configurations:
48-
- Delete the *contents* of the cookie-cutter generated `tofu/` directories
49-
from the `production` and `staging` environments.
50-
- Create a `main.tf` in those directories which uses `site/tofu/` as a
51-
[module](https://opentofu.org/docs/language/modules/), e.g. :
52-
53-
```
54-
...
55-
variable "environment_root" {
56-
type = string
57-
description = "Path to environment root, automatically set by activate script"
58-
}
59-
60-
module "cluster" {
61-
source = "../../site/tofu/"
62-
environment_root = var.environment_root
63-
64-
cluster_name = "foo"
65-
...
66-
}
67-
```
68-
69-
Note that:
35+
- When setting OpenTofu configurations:
7036

7137
- Environment-specific variables (`cluster_name`) should be hardcoded
72-
into the cluster module block.
38+
as arguments into the cluster module block at `environments/$ENV/tofu/main.tf`.
7339
- Environment-independent variables (e.g. maybe `cluster_net` if the
7440
same is used for staging and production) should be set as *defaults*
7541
in `environments/site/tofu/variables.tf`, and then don't need to
@@ -87,7 +53,7 @@ and referenced from the `site` and `production` environments, e.g.:
8753
instances) it may be necessary to configure or proxy `chronyd` via an
8854
environment hook.
8955

90-
- By default, the cookiecutter-provided OpenTofu configuration provisions two
56+
- By default, the site OpenTofu configuration provisions two
9157
volumes and attaches them to the control node:
9258
- "$cluster_name-home" for NFS-shared home directories
9359
- "$cluster_name-state" for monitoring and Slurm data

0 commit comments

Comments
 (0)