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

jira::facts don't work with All-in-One Puppet 4.x agent #151

Closed
aharden opened this issue Jun 16, 2016 · 8 comments · Fixed by #321
Closed

jira::facts don't work with All-in-One Puppet 4.x agent #151

aharden opened this issue Jun 16, 2016 · 8 comments · Fixed by #321

Comments

@aharden
Copy link
Contributor

aharden commented Jun 16, 2016

The AIO agent moved its ruby to /opt/puppetlabs/puppet/bin/ruby. "PE" detection logic in jira::facts hasn't been adjusted for the AIO agent. As a result, on nodes with the AIO agent, jira_facts.rb exists at both /etc/facter/facts.d/ and /etc/puppetlabs/facter/facts.d, and neither has a path to ruby that works, so both report Facter errors on agent runs. I know that changing the shebang in jira_facts.rb to #!/opt/puppetlabs/puppet/bin/ruby fixes this. I will try to put in a PR with updated logic for the AIO agent.

@bastelfreak
Copy link
Member

thanks for reporting this. It would be very cool if you can spin up a PR. We should be able to review + merge + publish a fixed version in a short timeframe.

@dpisano
Copy link
Contributor

dpisano commented Jul 4, 2016

I think that I figured out the logic to detect the AIO agent. Don't know if it will work with the AIO agent for PE. I don't have a way to test it on other version of puppet to see if still works with them. I can summit a PR to have you take a look at it.

@ekohl
Copy link
Member

ekohl commented May 28, 2020

Looks like this was fixed by now.

@ekohl ekohl closed this as completed May 28, 2020
@dpisano
Copy link
Contributor

dpisano commented May 29, 2020

This is still a problem unless you have ruby installed on your system. If you are using the OSS version of Puppet facts.rb will be made looking for the system installed ruby. As the AIO Puppet agent does not install ruby on the system, every time facts.rb is run it will fail because ruby is not installed. The only way around this is it installed ruby on the system or change jira::facts to check for the AIO agent and make facts.rb pointing to the puppet bundled ruby.

@ekohl
Copy link
Member

ekohl commented May 29, 2020

Ah, so this is

# Puppet Enterprise supplies its own ruby version if your using it.
# A modern ruby version is required to run the executable fact
if $facts['puppetversion'] =~ /Puppet Enterprise/ {
$ruby_bin = '/opt/puppet/bin/ruby'
$dir = 'puppetlabs/'
} else {
$ruby_bin = '/usr/bin/env ruby'
$dir = ''
}

I'd suggest changing the check to fact('aio_agent_version') =~ String[1]. Since I don't use it myself, I can't test it out but that should be a pretty trivial PR.

@ekohl ekohl reopened this May 29, 2020
@dpisano
Copy link
Contributor

dpisano commented May 29, 2020

Let me try to do it this weekend. I have a fork with this fixed for some time. I also have a dev environment to test it in.

@dpisano
Copy link
Contributor

dpisano commented May 30, 2020

I have submitted the PR, but it looks like I need to update some of the tests too. I'm pretty sure that Puppet 5 and 6 only come in an AIO version. If that is the case in jira_facts_spec.rb should I just set regexp_oss = %r{^#\!/opt/puppetlabs/puppet/bin/ruby$}?

@ekohl
Copy link
Member

ekohl commented May 31, 2020

I think so yes. Since Puppet 4, Puppetlabs only ships AIO packages.

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

Successfully merging a pull request may close this issue.

4 participants