diff --git a/deploy.py b/deploy.py index 4562227..60bb756 100644 --- a/deploy.py +++ b/deploy.py @@ -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()