From 2e70f642697a4f6e2df944befb8e2613161778a7 Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Tue, 13 Jun 2023 16:39:20 +0200 Subject: [PATCH] edit lxc config and fix path --- resources/lxc/100/config.json | 9 +++++++-- src/lxc/commands_utils.py | 2 +- src/utils/proxmox_utils.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/resources/lxc/100/config.json b/resources/lxc/100/config.json index edc4f53..4a8c24b 100644 --- a/resources/lxc/100/config.json +++ b/resources/lxc/100/config.json @@ -36,9 +36,14 @@ "steps": [ { "type": "script", - "path": "/global/install-docker.sh" + "local_path": "global/scripts/install-docker.sh" + }, + { + "type": "folder_copy", + "path": "data/", + "destination": "/var/" } ] }, - "deploy": [] + "deploy": {} } \ No newline at end of file diff --git a/src/lxc/commands_utils.py b/src/lxc/commands_utils.py index b5f4c5f..9925d7e 100644 --- a/src/lxc/commands_utils.py +++ b/src/lxc/commands_utils.py @@ -71,7 +71,7 @@ def _run_local_script_on_lxc(lxc: LXC, path: Path): """ # Copy the script to /tmp and run it from there - proxmox_utils.copy_file_to_lxc(lxc.get_id(), str(path), "/tmp/pdj-scripts/") + proxmox_utils.copy_file_to_lxc(lxc.get_id(), path, "/tmp/pdj-scripts/") lxc.run_command(f"bash /tmp/pdj-scripts/{path.name}") # with open(path, "r") as file: diff --git a/src/utils/proxmox_utils.py b/src/utils/proxmox_utils.py index 04b8bf9..8bbda1f 100644 --- a/src/utils/proxmox_utils.py +++ b/src/utils/proxmox_utils.py @@ -347,7 +347,7 @@ def copy_file_to_pve(path: Path, destination: str): """ config = get_config() - run_command_locally(f"scp {str(path)} {config['pve']['root']}@{config['pve']['host']}:{destination}") + run_command_locally(f"scp {str(path)} {config['pve']['user']}@{config['pve']['host']}:{destination}") def copy_file_to_lxc(lxc_id: int, path: Path, destination: str):