You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ubuntu-20-04: Uploading local state tree: /home/gquentin/Work/repositories/git/automation/Provisionners/SaltStack/states
2020/10/01 13:20:45 packer-builder-lxd plugin: lxc file push --debug -pr /home/gquentin/Work/repositories/git/automation/Provisionners/SaltStack/states packer-ubuntu-20-04/states
2020/10/01 13:20:45 packer-builder-lxd plugin: Running cp command: lxc file push --debug -pr /home/gquentin/Work/repositories/git/automation/Provisionners/SaltStack/states packer-ubuntu-20-04/states
=> here you can see packer copying states dir in the root (/) of target container
ubuntu-20-04: Moving states to /tmp/salt/states
2020/10/01 13:20:47 packer-builder-lxd plugin: Executing with lxc exec in container: packer-ubuntu-20-04 sudo sudo mv 'states' '/tmp/salt/states'
2020/10/01 13:20:47 packer-builder-lxd plugin: Executing lxc exec: /bin/sh []string{"/bin/sh", "-c", "lxc exec packer-ubuntu-20-04 -- /bin/sh -c \"sudo sudo mv 'states' '/tmp/salt/states'\""}
==> ubuntu-20-04: mv: cannot stat 'states': No such file or directory
=> here you can see in "sudo mv states /tmp/salt/states" that packer try to move states from /root/states and not /states since default lxc exec env is user root in /root
more theses directories are not theses specified in input variables
Regards
The text was updated successfully, but these errors were encountered:
This issue was originally opened by @gaetanquentin as hashicorp/packer#10023. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.
Overview of the Issue
packer salt module can't copy states tree when used with lxd: bad directories
Reproduction Steps
PACKER_LOG=1 packer build -on-error=ask -var-file=../../lab/01_common/default-variables.json lxd-ubuntu-20.04-saltmaster-2020.json
Packer/salt/lxd versions
packer >= 1.6.0: currently 1.6.4
salt version: 3001.1
lxd version: 4.6 (snap)
Simplified Packer Buildfile
variables:
"salt_local_pillars_dir": "/home/gquentin/Work/repositories/git/automation/Provisionners/SaltStack/pillar",
"salt_remote_pillars_dir": "/srv/pillar",
"salt_local_states_dir": "/home/gquentin/Work/repositories/git/automation/Provisionners/SaltStack/states",
"salt_remote_states_dir": "/srv",
"salt_temp_config_dir": "/tmp/salt"
other:
{
"builders": [
{
"type": "lxd",
"name": "ubuntu-20-04",
"image": "images:ubuntu/20.04",
"output_image": "ubuntu-20-04",
"publish_properties": {
"description": "Ubuntu focal amd64 with saltmaster 3001 built with packer "
},
"profile": "default",
"launch_config": {
"security.privileged": "false"
}
}
],
[ ..]
{
"type": "salt-masterless",
"local_state_tree": "{{user
salt_local_states_dir
}}","remote_state_tree": "{{user
salt_remote_states_dir
}}","local_pillar_roots": "{{user
salt_local_pillars_dir
}}","remote_pillar_roots": "{{user
salt_remote_pillars_dir
}}","temp_config_dir": "{{user
salt_temp_config_dir
}}","custom_state": "sys.tools,sys.locale,sys.sysctl,sys.network,apps.configmanager.salt.master,apps.versioncontrol.git",
"skip_bootstrap": "true",
"bootstrap_args": "-x python3 stable 3001.1 ",
"pause_before": "20s"
},
[ ..]
Operating system and Environment details
Host: ubuntu 20.04
lxd container image: ubuntu 20.04
Log Fragments and crash.log files
Regards
The text was updated successfully, but these errors were encountered: