Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"-":6: bad command when setting up an agent #25

Closed
tekenny opened this issue Sep 30, 2013 · 5 comments
Closed

"-":6: bad command when setting up an agent #25

tekenny opened this issue Sep 30, 2013 · 5 comments

Comments

@tekenny
Copy link
Contributor

tekenny commented Sep 30, 2013

When creating Cron[puppet_agent_at_boot] I get the following error
"-":6: bad command
errors in crontab file, can't install.

I get this when I try to apply
class { 'puppet::agent': env => 'dev', puppet_server => "puppet.$::domain", }

I confirmed that I can create a cron resource since the following works
cron { 'foo': command => 'echo foo', }

I am using the following modules on RHEL 6.4
ghoneycutt-common-1.0.2
ghoneycutt-puppet-2.1.2
leinaddm-htpasswd-0.0.1
puppetlabs-apache-0.8.1
puppetlabs-firewall-0.4.1
puppetlabs-mysql-0.9.0
puppetlabs-passenger-0.1.0
puppetlabs-stdlib-4.1.0

Any suggestions on what I may be doing wrong, what I can try or how I can be of assistance in resolving this issue would be appreciated.

@tekenny
Copy link
Contributor Author

tekenny commented Sep 30, 2013

I did a little more experimenting and found that the following run by itself does work even though the above doesn't

$at_boot_ensure = present
$my_cron_command = '/usr/bin/puppet agent --onetime --ignorecache --no-daemonize --no-usecacheonfailure --detailed-exitcodes --no-splay --noop'
$cron_user = root

cron { 'puppet_agent_once_at_boot':
ensure => $at_boot_ensure,
command => $my_cron_command,
user => $cron_user,
special => 'reboot',
}

after running this separately class { 'puppet::agent': ... } works

@tekenny
Copy link
Contributor Author

tekenny commented Nov 9, 2013

This issue eventually went away. I'm not sure what the cause actually was but suspect it was not due to this module so I'm closing the issue.

@tekenny tekenny closed this as completed Nov 9, 2013
@tekenny tekenny reopened this Nov 10, 2013
@tekenny
Copy link
Contributor Author

tekenny commented Nov 10, 2013

On a new RHEL 6.4 system this error is occurring for Class { 'puppet::agent': }

Since I'm using default parameters $run_method = 'service' and thus $my_cron_command = undef
This seems to cause a problem for Cron['puppet_agent_once_at_boot'] since command = undef
Thus causing the error
"-":6: bad command
errors in crontab file, can't install.

A quick work around is to set $run_at_boot => false whenever $run_method = 'service'

@tekenny
Copy link
Contributor Author

tekenny commented Nov 10, 2013

I am hoping that #37 will resolve this issue.

@ghoneycutt
Copy link
Owner

Thanks! Closing this and we can discuss in PR #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants