Code Monkey home page Code Monkey logo

Comments (13)

chris-rock avatar chris-rock commented on August 15, 2024

@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.

brentm5 avatar brentm5 commented on August 15, 2024

I will look at this tomorrow. Sorry about the late response just trying to get around to it.

from kitchen-inspec.

brentm5 avatar brentm5 commented on August 15, 2024

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.

chris-rock avatar chris-rock commented on August 15, 2024

Thanks for sharing the solution @bigbam505

from kitchen-inspec.

brentm5 avatar brentm5 commented on August 15, 2024

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.

chris-rock avatar chris-rock commented on August 15, 2024

@bigbam505 Good question. Let me think about it...

from kitchen-inspec.

chris-rock avatar chris-rock commented on August 15, 2024

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.

brentm5 avatar brentm5 commented on August 15, 2024

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.

chris-rock avatar chris-rock commented on August 15, 2024

I just tried your kitchen.yml with the latest inspec and it worked well without changing anything.

from kitchen-inspec.

rndmh3ro avatar rndmh3ro commented on August 15, 2024

Works for me, too!

from kitchen-inspec.

amcappelli avatar amcappelli commented on August 15, 2024

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.

qubitrenegade avatar qubitrenegade commented on August 15, 2024

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.

adamleff avatar adamleff commented on August 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.