hashicorp / packer-plugin-salt

This Packer provisioner has been archived due to it no longer being maintained. Users are encouraged to use the shell or shell-local provisioner to run the provisioning tools made available by this plugin. If interested in maintaining this plugin please reach out to us at packer@hashicorp.com.
https://www.packer.io/docs/provisioners/salt-masterless
Mozilla Public License 2.0
2 stars 5 forks source link

Packer image building fails with LXD complains /tmp/salt/minion #25

Open hc-github-team-packer opened 3 years ago

hc-github-team-packer commented 3 years ago

This issue was originally opened by @rupamkhaitan in https://github.com/hashicorp/packer/issues/9052 and has been migrated to this repository. The original issue description is below.


Packer version 1.5.5

Overview of the Issue

Packer lxd fails in the salt-masterless line complaining /tmp/salt/minion no such file or directory

If i revert packer version to 1.4.2 it works fine (so not sure what is broken in latest packer version)

{ "type": "salt-masterless", "local_state_tree": "../salt/states/base", "local_pillar_roots": "../salt/pillars/base", "bootstrap_args": "{{userbootstrap_args}} stable {{usersalt_version}}", "minion_config": "./files/minion" }

Packer version

1.5.5

Operating system and Environment details

Ubuntu 16.04

Log Fragments and crash.log files

noc-2-3-0-r1: Processing triggers for ureadahead (0.100.0-19.1) ... noc-2-3-0-r1: Processing triggers for systemd (229-4ubuntu21.27) ... noc-2-3-0-r1: INFO: Running install_ubuntu_stable_post() noc-2-3-0-r1: INFO: Running install_ubuntu_check_services() noc-2-3-0-r1: INFO: Running install_ubuntu_restart_daemons() noc-2-3-0-r1: INFO: Running daemons_running() noc-2-3-0-r1: * INFO: Salt installed! 2020/04/12 12:16:02 packer-builder-lxd plugin: lxc exec execution exited with '0': 'sudo sh /tmp/install_salt.sh stable 2015.8' 2020/04/12 12:16:02 packer-builder-lxd plugin: [INFO] RPC endpoint: Communicator ended with: 0 2020/04/12 12:16:02 [INFO] 0 bytes written for 'stderr' 2020/04/12 12:16:02 [INFO] 24387 bytes written for 'stdout' 2020/04/12 12:16:02 [INFO] RPC client: Communicator ended with: 0 2020/04/12 12:16:02 [INFO] RPC endpoint: Communicator ended with: 0 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 24387 bytes written for 'stdout' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 0 bytes written for 'stderr' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] RPC client: Communicator ended with: 0 noc-2-3-0-r1: Creating remote temporary directory: /tmp/salt noc-2-3-0-r1: Creating directory: /tmp/salt 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing with lxc exec in container: packer-noc-2-3-0-r1 sudo mkdir -p '/tmp/salt' 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing lxc exec: /bin/sh []string{"/bin/sh", "-c", "lxc exec packer-noc-2-3-0-r1 -- /bin/sh -c \"sudo mkdir -p '/tmp/salt'\""} 2020/04/12 12:16:02 packer-builder-lxd plugin: lxc exec execution exited with '0': 'sudo mkdir -p '/tmp/salt'' 2020/04/12 12:16:02 packer-builder-lxd plugin: [INFO] RPC endpoint: Communicator ended with: 0 2020/04/12 12:16:02 [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 [INFO] 0 bytes written for 'stderr' 2020/04/12 12:16:02 [INFO] RPC client: Communicator ended with: 0 2020/04/12 12:16:02 [INFO] RPC endpoint: Communicator ended with: 0 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 0 bytes written for 'stderr' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] RPC client: Communicator ended with: 0 noc-2-3-0-r1: Uploading minion config: ./files/minion-noc 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 249 bytes written for 'uploadData' 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing with lxc exec in container: packer-noc-2-3-0-r1 test -d "minion" 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing lxc exec: /bin/sh []string{"/bin/sh", "-c", "lxc exec packer-noc-2-3-0-r1 -- /bin/sh -c \"test -d \"minion\"\""} 2020/04/12 12:16:02 [INFO] 249 bytes written for 'uploadData' 2020/04/12 12:16:02 packer-builder-lxd plugin: lxc exec execution exited with '1': 'test -d "minion"' 2020/04/12 12:16:02 packer-builder-lxd plugin: Running copy command: lxc file push - packer-noc-2-3-0-r1/minion noc-2-3-0-r1: Moving minion to /tmp/salt/minion 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing with lxc exec in container: packer-noc-2-3-0-r1 sudo sudo mv 'minion' '/tmp/salt/minion' 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing lxc exec: /bin/sh []string{"/bin/sh", "-c", "lxc exec packer-noc-2-3-0-r1 -- /bin/sh -c \"sudo sudo mv 'minion' '/tmp/salt/minion'\""} ==> noc-2-3-0-r1: mv: cannot stat 'minion': No such file or directory 2020/04/12 12:16:02 packer-builder-lxd plugin: lxc exec execution exited with '1': 'sudo sudo mv 'minion' '/tmp/salt/minion'' 2020/04/12 12:16:02 packer-builder-lxd plugin: [INFO] RPC endpoint: Communicator ended with: 1 2020/04/12 12:16:02 [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 [INFO] 52 bytes written for 'stderr' 2020/04/12 12:16:02 [INFO] RPC client: Communicator ended with: 1 2020/04/12 12:16:02 [INFO] RPC endpoint: Communicator ended with: 1 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 52 bytes written for 'stderr' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] RPC client: Communicator ended with: 1 noc-2-3-0-r1: Make sure directory /etc/salt exists noc-2-3-0-r1: Creating directory: /etc/salt 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing with lxc exec in container: packer-noc-2-3-0-r1 sudo mkdir -p '/etc/salt' 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing lxc exec: /bin/sh []string{"/bin/sh", "-c", "lxc exec packer-noc-2-3-0-r1 -- /bin/sh -c \"sudo mkdir -p '/etc/salt'\""} 2020/04/12 12:16:02 packer-builder-lxd plugin: lxc exec execution exited with '0': 'sudo mkdir -p '/etc/salt'' 2020/04/12 12:16:02 packer-builder-lxd plugin: [INFO] RPC endpoint: Communicator ended with: 0 2020/04/12 12:16:02 [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 [INFO] 0 bytes written for 'stderr' 2020/04/12 12:16:02 [INFO] RPC client: Communicator ended with: 0 2020/04/12 12:16:02 [INFO] RPC endpoint: Communicator ended with: 0 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 0 bytes written for 'stderr' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] RPC client: Communicator ended with: 0 noc-2-3-0-r1: Moving /tmp/salt/minion to /etc/salt/minion 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing with lxc exec in container: packer-noc-2-3-0-r1 sudo sudo mv '/tmp/salt/minion' '/etc/salt/minion' 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing lxc exec: /bin/sh []string{"/bin/sh", "-c", "lxc exec packer-noc-2-3-0-r1 -- /bin/sh -c \"sudo sudo mv '/tmp/salt/minion' '/etc/salt/minion'\""} ==> noc-2-3-0-r1: mv: cannot stat '/tmp/salt/minion': No such file or directory 2020/04/12 12:16:02 packer-builder-lxd plugin: lxc exec execution exited with '1': 'sudo sudo mv '/tmp/salt/minion' '/etc/salt/minion'' 2020/04/12 12:16:02 packer-builder-lxd plugin: [INFO] RPC endpoint: Communicator ended with: 1 2020/04/12 12:16:02 [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 [INFO] 62 bytes written for 'stderr' 2020/04/12 12:16:02 [INFO] RPC client: Communicator ended with: 1 2020/04/12 12:16:02 [INFO] RPC endpoint: Communicator ended with: 1 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 0 bytes written for 'stdout' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] 62 bytes written for 'stderr' 2020/04/12 12:16:02 packer-provisioner-salt-masterless plugin: [INFO] RPC client: Communicator ended with: 1 2020/04/12 12:16:02 [INFO] (telemetry) ending salt-masterless 2020/04/12 12:16:02 packer-builder-lxd plugin: Executing lxc command: []string{"delete", "--force", "packer-noc-2-3-0-r1"} ==> noc-2-3-0-r1: Unregistering and deleting deleting container... 2020/04/12 12:16:03 packer-builder-lxd plugin: stdout: 2020/04/12 12:16:03 packer-builder-lxd plugin: stderr: 2020/04/12 12:16:03 [INFO] (telemetry) ending lxd Build 'noc-2-3-0-r1' errored: Unable to move /tmp/salt/minion to /etc/salt/minion: Unable to move /tmp/salt/minion to /etc/salt/minion: Bad exit status: 1

==> Some builds didn't complete successfully and had errors: 2020/04/12 12:16:03 machine readable: error-count []string{"1"} ==> Some builds didn't complete successfully and had errors: 2020/04/12 12:16:03 machine readable: noc-2-3-0-r1,error []string{"Unable to move /tmp/salt/minion to /etc/salt/minion: Unable to move /tmp/salt/minion to /etc/salt/minion: Bad exit status: 1"} ==> Builds finished but no artifacts were created. 2020/04/12 12:16:03 [INFO] (telemetry) Finalizing. --> noc-2-3-0-r1: Unable to move /tmp/salt/minion to /etc/salt/minion: Unable to move /tmp/salt/minion to /etc/salt/minion: Bad exit status: 1

==> Builds finished but no artifacts were created. 2020/04/12 12:16:03 waiting for all plugin processes to complete... 2020/04/12 12:16:03 /usr/local/bin/packer: plugin process exited 2020/04/12 12:16:03 /usr/local/bin/packer: plugin process exited

nywilken commented 3 years ago

With the archival of this repository all open issues will be marked as read-only. If you wish to further discuss this plugin or any of its open issues we invite you to open a discussion on the Packer community forum.

More details on the plugin archiving process for this provisioner can be found on the Plans to Archive Unmaintained Packer Provisioner Plugins blog post.