-2

I've installed serverspec on my server command to execute serverspec is serverspec-init. But this is working for me only when I do the full command path. /usr/local/lib/ruby/gems/2.7.0/gems/serverspec-2.41.5/bin/serverspec-init but when i do export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

serverspec-init command works fine

I need to update these steps into ansible can anyone help me out to do ansible steps

Thankyou

akp
  • 1
  • 1
  • I'm not entirely clear what's going on here. In which path exactly is the `serverspec-init` command actually installed? – larsks Apr 30 '20 at 23:37

1 Answers1

0

You can provide an environment to both command: and shell:, and likely a bunch of other modules

- command: serverspec-init
  environment:
     PATH: "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
mdaniel
  • 31,240
  • 5
  • 55
  • 58
  • Then please mark the answer as accepted so it will let others know it is a solution that worked for you – mdaniel May 05 '20 at 16:05