Update 'hertzner.py'

This commit is contained in:
Patryk Gałka 2024-02-08 05:14:35 +01:00
parent 415abc7c8b
commit ef5f109964

View File

@ -6,7 +6,6 @@ from hcloud.server_types import ServerType
from hcloud._exceptions import APIException
from hcloud.servers.domain import ServerCreatePublicNetwork
from time import sleep
YOUR_API_TOKEN = ""
@ -77,11 +76,11 @@ package_upgrade: true
groups:
- docker
system_info:
default_user:
groups: [ docker ]
packages:
- apt-transport-https
- ca-certificates
@ -89,7 +88,7 @@ packages:
- gnupg
- lsb-release
- unattended-upgrades
runcmd:
- mkdir -p /etc/apt/keyrings
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
@ -98,15 +97,15 @@ runcmd:
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
- systemctl enable docker
- systemctl start docker
- git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3
- git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3.git /zpzc-3
- docker compose -f /zpzc-3/db.yml up -d
- echo 'Done'
final_message: "The system is finally up, after $UPTIME seconds"
bootcmd:
- cd zpzc-3
- docker compose -f db.yml up -d
"""
- docker compose -f /zpzc-3/db.yml up -d
final_message: "The system is finally up, after $UPTIME seconds"
"""
)
db_server = response.server
print(f"{db_server.id=} {db_server.name=} {db_server.status=}")
@ -129,11 +128,11 @@ package_upgrade: true
groups:
- docker
system_info:
default_user:
groups: [ docker ]
packages:
- apt-transport-https
- ca-certificates
@ -141,7 +140,7 @@ packages:
- gnupg
- lsb-release
- unattended-upgrades
runcmd:
- mkdir -p /etc/apt/keyrings
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
@ -150,18 +149,16 @@ runcmd:
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
- systemctl enable docker
- systemctl start docker
- git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3
- cd zpzc-3
- docker compose -f db.yml up -d
- git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3.git /zpzc-3
- docker compose -f /zpzc-3/gitea.yml up -d
- echo 'Done'
bootcmd:
- docker compose -f /zpzc-3/gitea.yml up -d
final_message: "The system is finally up, after $UPTIME seconds"
bootcmd:
- cd zpzc-3
- docker compose -f db.yml up -d
""",
"""
)
_gitea_server = gitea_server.server
print(f"{_gitea_server.id=} {_gitea_server.name=} {_gitea_server.status=}, {gitea_server.root_password} ")