mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
server? server!
This commit is contained in:
parent
8b8313b22e
commit
6bb17f9c65
8 changed files with 100 additions and 3 deletions
|
|
@ -25,7 +25,6 @@
|
||||||
pythonPkgs = python.withPackages (ps: with ps; [
|
pythonPkgs = python.withPackages (ps: with ps; [
|
||||||
virtualenv
|
virtualenv
|
||||||
pip
|
pip
|
||||||
ansible-core
|
|
||||||
]);
|
]);
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
|
|
@ -34,6 +33,8 @@
|
||||||
pythonPkgs
|
pythonPkgs
|
||||||
ansible
|
ansible
|
||||||
ansible-lint
|
ansible-lint
|
||||||
|
certbot
|
||||||
|
dig
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
12
html.html
Normal file
12
html.html
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>uwu</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
meow :3
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
8
new/README.md
Normal file
8
new/README.md
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# exciting new stuff!!
|
||||||
|
|
||||||
|
https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-ansible-on-ubuntu-18-04
|
||||||
|
|
||||||
|
## server??
|
||||||
|
|
||||||
|
Each VPS has an nginx running _on the host_, not inside docker. It's the entrypoint to the stuff.
|
||||||
|
Everything else runs in a docker container via docker compose.
|
||||||
33
new/docker-compose-2.yml
Normal file
33
new/docker-compose-2.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
version: '3.3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
container_name: nginx
|
||||||
|
restart: always
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
volumes:
|
||||||
|
- "${NGINX_CONF_PATH}:/etc/nginx/nginx.conf:ro"
|
||||||
|
- "/etc/letsencrypt:/etc/nginx/certs:ro"
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
registry:
|
||||||
|
container_name: registry-c
|
||||||
|
restart: always
|
||||||
|
image: registry:2
|
||||||
|
volumes:
|
||||||
|
- "${REGISTRY_CONF_DIR}/config.yml:/etc/docker/registry/config.yml"
|
||||||
|
- "/var/lib/docker/registry:/var/lib/registry"
|
||||||
|
- "/etc/letsencrypt:/etc/letsencrypt"
|
||||||
|
environment:
|
||||||
|
- REGISTRY_HTTP_TLS_CERTIFICATE=/etc/letsencrypt/live/nilstrieb.dev/fullchain.pem
|
||||||
|
- REGISTRY_HTTP_TLS_KEY=/etc/letsencrypt/live/nilstrieb.dev/privkey.pem
|
||||||
|
- REGISTRY_AUTH=htpasswd
|
||||||
|
- REGISTRY_AUTH_HTPASSWD_REALM=Realm
|
||||||
|
- REGISTRY_AUTH_HTPASSWD_PATH=/htpasswd
|
||||||
|
- "/etc/htpasswd:/htpasswd"
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal:
|
||||||
6
new/inventory.yml
Normal file
6
new/inventory.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
vps:
|
||||||
|
hosts:
|
||||||
|
# vps1:
|
||||||
|
# ansible_host: vps1.nilstrieb.dev
|
||||||
|
vps2:
|
||||||
|
ansible_host: vps2.nilstrieb.dev
|
||||||
36
new/playbooks/basic-setup.yml
Normal file
36
new/playbooks/basic-setup.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
- name: Basic Server setup
|
||||||
|
hosts: all
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- name: Test ping
|
||||||
|
ansible.builtin.ping:
|
||||||
|
- name: Install docker
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: docker.io
|
||||||
|
state: present
|
||||||
|
- name: Install nginx
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: nginx
|
||||||
|
state: present
|
||||||
|
- name: Ensure nginx is started
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: nginx
|
||||||
|
state: started
|
||||||
|
- name: Create hello world file
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /var/www/html/index.html
|
||||||
|
content: |
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>uwu</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
meow :3
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
mode: u=rw,g=r,o=r
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
- name: uwu
|
|
||||||
3
new/run.sh
Executable file
3
new/run.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
ansible-playbook -i inventory.yml playbooks/basic-setup.yml -u root
|
||||||
Loading…
Add table
Add a link
Reference in a new issue