1

Trying to run the command eval `ssh-agent -s with the command option puppet which gives me these error:

exec { 'eval' :
        command => "eval `ssh-agent -s`",
     }

Gives me this error:

Error: Validation of Exec[eval] failed: 'eval `ssh-agent -s`' is not qualified and no path was specified. Please qualify the command or specify a path. at /puppet.pp:18
    Wrapped exception:
'eval `ssh-agent -s`' is not qualified and no path was specified. Please qualify the command or specify a path.
user3270211
  • 915
  • 4
  • 20
  • 42

3 Answers3

3

You need to setup PATH for you exec. I can be defined locally, by setting path parameter :

exec { 'eval' :
        command => "eval `ssh-agent -s`",
        path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
     }

or globally:

Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }
kkamil
  • 2,593
  • 11
  • 21
0

You need to use fully qualified path.

For example either:

exec { "sample":
  command => "/usr/bin/test",
}

or:

exec { "sample":
  path    => ['/usr/bin', '/usr/sbin', '/bin'],
  command => "test",
}
kenorb
  • 155,785
  • 88
  • 678
  • 743
-1

Your approach is flawed.

It is not possible to manipulate the Puppet agent's environment by running commands through exec resources. Each such resource forks a subprocess that is independent, with the main environment remaining immutable.

Update: The best approach to allow Puppet to run with an ssh-agent depends on how you start the Puppet agent. For example, if you use /etc/init.d/puppet start, you will want to change this init script to wrap the Puppet process in an ssh-agent directly. If you run from cron, change the job to run ssh-agent etc.

Felix Frank
  • 8,125
  • 1
  • 23
  • 30