Skip to content

Commit 143480a

Browse files
author
Alan Christie
committed
refactor: Removed ansible code
1 parent 7b06614 commit 143480a

20 files changed

+11
-572
lines changed

.devcontainer/requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Requirements file for the dev-container
2-
ansible >= 11.2.0
3-
kubernetes == 31.0.0
42
poetry == 1.8.5
53
pre-commit == 4.3.0

README.md

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -62,64 +62,9 @@ current health of your clone with: -
6262
pre-commit run --all-files
6363

6464
## Installation
65-
The repository contains an ansible playbook that can be used to simplify the
66-
deployment of the application into a pre-existing Kubernetes **Namespace** but you will
67-
need to customise the playbook by first defining your own variables.
68-
69-
To install the application follow the steps below.
70-
71-
> You will need access to your Kubernetes cluster and a **KUBECONFIG** file.
72-
73-
From a poetry shell, install the required dependencies: -
74-
75-
poetry install --with deploy
76-
77-
Move to the `ansible` directory and define your variables: -
78-
79-
pushd ansible
80-
81-
> All the _required_ variables can be found at the top of the standard
82-
`default/main.yaml` file, but you are advised to inspect all the variables to
83-
ensure they are suitable for your installation (variables are defined in
84-
`default/main.yaml` and `vars/main.yaml`).
85-
86-
You can create a `parameters.yaml` file and set your variables there.
87-
A `parameters-template.yaml` file is provided as an example. This is protected from
88-
accidental commits as it's in the project's `.gitignore` file: -
89-
90-
cp parameters-template.yaml parameters.yaml
91-
92-
Then, when you have set your variables, identify your **KUBECONFIG** file,
93-
and run the playbook: -
94-
95-
export KUBECONFIG=~/k8s-config/nw-xch-dev.yaml
96-
ansible-playbook site.yaml -e @parameters.yaml
97-
98-
Once deployed the application's internal API will be behind the service
99-
`ess-ws-api` on port `8081`, and available to any application running in the
100-
cluster. The Account Server will be able to manage event streams via the URL
101-
`http://ess-ws-api:8081/event-stream/`.
102-
103-
The external web-socket service will be available on the ingress host you've specified,
104-
as either a `ws://` or `wss://` service, depending on whether you have set
105-
the Ansible variable `ess_cert_issuer`. If the host is `example.com` you should be able
106-
to connect to an unsecured web socket using the URL `ws://example.com/event-stream/{uuid}`
107-
or `wss://example.com/event-stream/{uuid}` for a secured connection.
108-
109-
To update the running image (to deploy a new tagged version) just re-run the
110-
playbook with a suitable value for `ess_image_tag`.
111-
112-
To remove the application run the playbook again, but set the `ess_state` variable
113-
to `absent`: -
114-
115-
ansible-playbook site.yaml -e @parameters.yaml -e ess_state=absent
116-
117-
## Troubleshooting
118-
The deployed application uses the Python logging framework. Significant events
119-
are written to the console, and in a rotating file in `/logs/es.log`.
120-
121-
Access logging is written to the rotating file handler `/logs/access.log`,
122-
and WSGI logging to `/logs/wsgi.log`.
65+
Use our peer repository (squonk2-fastapi-ws-event-stream-ansible), which
66+
contains an ansible playbook that can be used to simplify the
67+
deployment of the application into a pre-existing Kubernetes **Namespace**.
12368

12469
## Local development
12570
You can build and run the service using `docker compose`: -
@@ -296,6 +241,13 @@ events for several days.
296241
especially if you are storing these values in a file or database. You might
297242
instead record message references in _blocks_ of 100, or 1,000.
298243

244+
## Troubleshooting
245+
The deployed application uses the Python logging framework. Significant events
246+
are written to the console, and in a rotating file in `/logs/es.log`.
247+
248+
Access logging is written to the rotating file handler `/logs/access.log`,
249+
and WSGI logging to `/logs/wsgi.log`.
250+
299251
---
300252

301253
[black]: https://black.readthedocs.io/en/stable
@@ -307,3 +259,4 @@ events for several days.
307259
[poetry]: https://python-poetry.org
308260
[python-dateutil]: https://github.com/dateutil/dateutil
309261
[rabbitmq]: https://www.rabbitmq.com
262+
[squonk2-fastapi-ws-event-stream-ansible]: https://github.com/InformaticsMatters/squonk2-fastapi-ws-event-stream-ansible

ansible/ansible.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

ansible/inventory.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

ansible/parameters-local.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

ansible/parameters-template.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

ansible/roles/app/defaults/main.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

ansible/roles/app/tasks/deploy.yaml

Lines changed: 0 additions & 64 deletions
This file was deleted.

ansible/roles/app/tasks/main.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

ansible/roles/app/tasks/prep.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)