fix volume
This commit is contained in:
parent
0f9c253edf
commit
bc3d43a82b
@ -96,6 +96,8 @@ if not volume:
|
|||||||
# print(f"Wolumen {volume_name} został utworzony")
|
# print(f"Wolumen {volume_name} został utworzony")
|
||||||
|
|
||||||
|
|
||||||
|
volume_id = volume.volume.id
|
||||||
|
|
||||||
cloud_init_gitea = f'''#cloud-config
|
cloud_init_gitea = f'''#cloud-config
|
||||||
packages:
|
packages:
|
||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
@ -135,6 +137,10 @@ runcmd:
|
|||||||
- chmod +x /usr/local/bin/docker-compose
|
- chmod +x /usr/local/bin/docker-compose
|
||||||
- systemctl start docker
|
- systemctl start docker
|
||||||
- systemctl enable 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
|
- cd /root/ && docker-compose up -d
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -145,7 +151,8 @@ gitea_server = client.servers.create(
|
|||||||
ssh_keys=[ssh_key],
|
ssh_keys=[ssh_key],
|
||||||
networks=[vnet],
|
networks=[vnet],
|
||||||
location=Location("hel1"),
|
location=Location("hel1"),
|
||||||
user_data=cloud_init_gitea
|
user_data=cloud_init_gitea,
|
||||||
|
volumes=[volume.volume]
|
||||||
)
|
)
|
||||||
|
|
||||||
gitea_server.action.wait_until_finished()
|
gitea_server.action.wait_until_finished()
|
||||||
|
Loading…
Reference in New Issue
Block a user