This commit is contained in:
fix 2023-11-13 19:01:26 +01:00
commit e2296ec48a
5 changed files with 51 additions and 0 deletions

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# the task
see ()[task.md]
# setup
## use ansible runtime container
Because ansible setups have requirements towards used python versions, libraries etc,
I provide a unified solution everyone that has a contaner runtime like `docker` installed can use.
This also prevents me from needing to handle python dependencies in conflicting versions.
```shell
# build the container
docker build -t ansible-runtime:local ansible-runtime
# then run it
docker run -v ${PWD}/ansible:/home/user/workdir:ro --rm -it ansible-runtime:local
```

View File

@ -0,0 +1,15 @@
FROM python:3.11
ARG UID=1000
ENV UID=${UID}
ADD requirements.txt /requirements.txt
RUN useradd -u ${UID} user
USER user
WORKDIR /home/user
RUN --mount=type=cache,target=/home/user/.cache/pip pip install -r /requirements.txt
ENV PATH="${PATH}:/home/user/.local/bin"
ENTRYPOINT ["/bin/bash"]

View File

@ -0,0 +1,2 @@
ansible==8.6.1
ansible-core==2.15.6

2
ansible/inventory.yaml Normal file
View File

@ -0,0 +1,2 @@
docker_host:
localhost:

13
task.md Normal file
View File

@ -0,0 +1,13 @@
# the task
Loadbalancing the 2 nginx instance
* Use Ansible to install and configure the Nginx and HaProxy on the Systems
* Setup 3 Linux Systems (Cloud, Local VM or Docker)
* 2 x nginx serving a static page be creative ;)
* 1 x haproxy
* with SSL support (self signed ca or LetsEncrypt)
* with HTTP/2
* Setup routing
* `/` -> request to do both Nginx Instances
* `/1` -> requests are served by Nginx Instance 1 only
* `/2` -> requests are served by Nginx Instance 2 only