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
{{ message }}
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
This issue was originally opened by @thompsm in hashicorp/packer#7510 and has been migrated to this repository. The original issue description is below.
Packer inspec provisioner incorrectly determines a files user and owner
Packer version 1.3.5 and 1.4.0
Host platform RHEL 6, 7, and Amazon Linux 2, using the amazon-ebs builder
describe file('/etc/ssh/sshd_config') do
its('mode') { should cmp '0600' }
it { should be_owned_by 'root' }
its('group') { should eq 'root' }
end
The output from packer shows:
amazon-ebs:
amazon-ebs: Profile: tests from ./file.rb (tests from ..file.rb)
amazon-ebs: Version: (not specified)
amazon-ebs: Target: ssh://xx.xx@127.0.0.1:59032
amazon-ebs:
amazon-ebs: File /etc/ssh/sshd_config
amazon-ebs: × should be owned by "root"
amazon-ebs: expected `File /etc/ssh/sshd_config.owned_by?("root")` to return true, got false
amazon-ebs: ✔ mode should cmp == "0600"
amazon-ebs: × group should eq "root"
amazon-ebs:
amazon-ebs: expected: "root"
amazon-ebs: got: "root\r"
amazon-ebs:
amazon-ebs: (compared using ==)
amazon-ebs:
amazon-ebs:
amazon-ebs: Test Summary: 1 successful, 2 failures, 0 skipped
==> amazon-ebs: Error executing Inspec: Non-zero exit status: exit status 100
If I run the same inspec test file, but directly using the inspec command outside of packer to the same host I get:
Version: (not specified)
Target: ssh://ec2-user@X.X.X.X:22
File /etc/ssh/sshd_config
✔ should be owned by "root"
✔ mode should cmp == "0600"
✔ group should eq "root"
Test Summary: 3 successful, 0 failures, 0 skipped
The text was updated successfully, but these errors were encountered:
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.
This issue was originally opened by @thompsm in hashicorp/packer#7510 and has been migrated to this repository. The original issue description is below.
Packer inspec provisioner incorrectly determines a files user and owner
This is my provisioners section of my template:
file.rb has:
The output from packer shows:
If I run the same inspec test file, but directly using the inspec command outside of packer to the same host I get:
The text was updated successfully, but these errors were encountered: