fix volume

This commit is contained in:
Krzysztof Raczyński 2024-11-25 22:22:15 +01:00
parent 0f9c253edf
commit bc3d43a82b

View File

@ -96,6 +96,8 @@ if not volume:
# print(f"Wolumen {volume_name} został utworzony")
volume_id = volume.volume.id
cloud_init_gitea = f'''#cloud-config
packages:
- apt-transport-https
@ -135,6 +137,10 @@ runcmd:
- chmod +x /usr/local/bin/docker-compose
- systemctl start docker
- systemctl enable docker
- mkfs.ext4 -F /dev/disk/by-id/scsi-0HC_Volume_{volume_id}
- mkdir /mnt/{volume_name}
- mount -o discard,defaults /dev/disk/by-id/scsi-0HC_Volume_{volume_id} /mnt/{volume_name}
- echo "/dev/disk/by-id/scsi-0HC_Volume_{volume_id} /mnt/{volume_name} ext4 discard,nofail,defaults 0 0" >> /etc/fstab
- cd /root/ && docker-compose up -d
'''
@ -145,7 +151,8 @@ gitea_server = client.servers.create(
ssh_keys=[ssh_key],
networks=[vnet],
location=Location("hel1"),
user_data=cloud_init_gitea
user_data=cloud_init_gitea,
volumes=[volume.volume]
)
gitea_server.action.wait_until_finished()