Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with inline script command - difference with ":shell, :inline" and "vagrant ssh" #13473

Open
Wolvverine opened this issue Jul 10, 2024 · 0 comments

Comments

@Wolvverine
Copy link

in vagrantfile:

SMBPASSWORD = "test"
test1.vm.provision :shell, :inline => "printf 'vagrant\n#{SMBPASSWORD}\n#{SMBPASSWORD}\n'"
test1.vm.provision :shell, :inline => "printf '%s\n' vagrant #{SMBPASSWORD} #{SMBPASSWORD}'"
test1.vm.provision :shell, :inline => "printf '%s\n' vagrant #{SMBPASSWORD} #{SMBPASSWORD} | passwd vagrant"
test1.vm.provision :shell, :inline => "printf \"vagrant\n#{SMBPASSWORD}\n#{SMBPASSWORD}\n\" | passwd vagrant"

when using "vagrant ssh" works without any problem, the test also shows that it correctly substitutes the variable.

Expected behavior

Correct command execution on linux.

Actual behavior

==> test1: Running provisioner: shell...
    test1: Running: inline script
    test1: New password: Retype new password: Sorry, passwords do not match.
    test1: passwd: Authentication token manipulation error
    test1: passwd: password unchanged
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Reproduction information

Vagrant version

Host operating system

Windows 10 with hyper-v

Guest operating system

ubuntu linux, mint linux,debian

Steps to reproduce

Above stated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant