Comments (13)
@bigbam505 CentOS requests a PTY session. This may be related to inspec/train#60
Could you try to set
cat /etc/sudoers.d/chef
chef ALL=(root) NOPASSWD: ALL
Defaults!ALL !requiretty
from kitchen-inspec.
I will look at this tomorrow. Sorry about the late response just trying to get around to it.
from kitchen-inspec.
Was able to fix this with a small hack not sure if there was a more elegant solution for this.
execute 'Set !require tty for kitchen user' do
action :run
command 'echo "Defaults!ALL !requiretty" >> /etc/sudoers.d/kitchen'
not_if 'grep "Defaults!ALL !requiretty" /etc/sudoers.d/kitchen'
end
from kitchen-inspec.
Thanks for sharing the solution @bigbam505
from kitchen-inspec.
Not really sure this is a solution but rather a way around the issue 😄 . Is there a way to change this at a higher level? Maybe or a way for the verifier to hook in and configure itself and perform this itself?
from kitchen-inspec.
@bigbam505 Good question. Let me think about it...
from kitchen-inspec.
InSpec 0.26.0 includes a fix inspec/train#112 that improves ssh access to CentOS/RHEL and OSX. Please retry with the latest InSpec.
from kitchen-inspec.
This did not work right out of the box. Are there any settings I need to set as well? I still got the same ttl issue without the hack that I included above.
from kitchen-inspec.
I just tried your kitchen.yml with the latest inspec and it worked well without changing anything.
from kitchen-inspec.
Works for me, too!
from kitchen-inspec.
I'm having the same issue with centos-7.1 using inspec 0.26.0. I can set Defaults !requiretty
to get around it, but this isn't required with centos-6.7. I assume this is because Defaults requiretty
isn't set by default for that image.
from kitchen-inspec.
We're experiencing the same issue with kitchen-openstack.
What I'm not sure I understand is the difference in how kitchen-openstack and kitchen-inspec connect to the VM. Just like in kitchen-docker, kitchen connects to the VM (in our case we ssh) as a non-root user, then sudos to perform the client install and client run.
Why does my test kitchen run not have the PTY error but inspec does? Is kitchen-openstack/kitchen-docker somehow requesting a PTY?
This is using current ChefDK/Inspec/train (well, chefdk seemed to come with train 0.23.0, I manually installed 0.25.0)
$ chef -v
Chef Development Kit Version: 1.5.0
chef-client version: 12.21.2
delivery version: master (17c1b0fed9be4c70f69091a6d21a4cbf0df60a23)
berks version: 5.6.4
kitchen version: 1.16.0
inspec version: 1.25.1
$ gem list | grep inspec
debug_inspector (0.0.2)
inspec (1.25.1)
kitchen-inspec (0.17.0)
$ gem list | grep train
train (0.25.0, 0.23.0)
from kitchen-inspec.
InSpec/Train does not request a PTY as it hampers our ability to differentiate between STDOUT and STDIN, and many core resources need that separation in order to function properly. Any sudo configurations will need to be modified to not require a TTY accordingly.
I will be closing this issue now but please feel free to let us know if you feel it should be reopened. Thank you!
from kitchen-inspec.
Related Issues (20)
- Implement control blacklisting HOT 5
- Expeditor cannot find agent for inspec/kitchen-inspec HOT 6
- Enable the ability to pass a inspec `config.yml` file to kitchen
- Incorrect lower bound specification for `inspec` dependency HOT 2
- 'junit' is not a valid reporter type in chef workstation 20.9.136 HOT 5
- Error when using plugin-based reporters and multiple instances HOT 1
- WinRM execution expired (HTTPClient::ConnectTimeoutError)
- inspec array input treated as hash w/ keys HOT 1
- junit(2) is not a valid reporter type HOT 2
- v2.4.0 Regression: reporters HOT 1
- 'aws_lambda' resource not identified
- Lifecycle Hooks Do Not Fire If InSpec Tests Fail HOT 1
- Dependabot can't resolve your Ruby dependency files
- kitchen verify fails on Windows HOT 1
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Documentation needs to be moved to https://kitchen.ci/docs/verifiers/inspec/
- Waivers file is not used HOT 4
- add support for inspec 6.6.0, updated reporters and config options
- add the ability to pass any inspec --'flags' to the verifier - such as 'enhanced-outcomes' or any that we add in the future HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitchen-inspec.