Code Monkey home page Code Monkey logo

Comments (4)

Joseph-R avatar Joseph-R commented on August 18, 2024

I think the issue is with the code itself.

I confirmed the ambari repo was not installed:

[root@ip-10-0-1-78 yum.repos.d]# ls
CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-Media.repo  CentOS-Vault.repo  elrepo.repo  epel.repo  epel-testing.repo

I think you need to bring the guards within the remote_file resource block, like so:

case node['platform']
when "redhat","centos","amazon","scientific"
  case node['platform_version'].to_i
  when 5
    yum_repo = node['ambari']['rhel_5_repo']
  when 6
    yum_repo = node['ambari']['rhel_6_repo']
  end
  remote_file "/etc/yum.repos.d/ambari.repo" do
    source yum_repo
    not_if { File.exists?("/etc/yum.repos.d/ambari.repo") }
  end
when "suse"
  remote_file "/etc/zypp/repos.d/ambari.repo" do
    source node['ambari']['suse_11_repo']
    not_if { File.exists?("/etc/zypp/repos.d/ambari.repo") }
  end

That worked for me. Let me know if you want me to write that up and submit a pull request.

from ambari.

jp avatar jp commented on August 18, 2024

Hey Joe, thanks for your feedback. I would be happy if you can submit a PR
for this. There is not tests yet for this cookbook, so just write up your
changes ;)
On Apr 12, 2015 3:29 PM, "JoeReid-Korrelate" [email protected]
wrote:

I think the issue is with the code itself.

I confirmed the ambari repo was not installed:

[root@ip-10-0-1-78 yum.repos.d]# ls
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo elrepo.repo epel.repo epel-testing.repo

I think you need to bring the guards within the remote_file resource
block, like so:

case node['platform']
when "redhat","centos","amazon","scientific"
case node['platform_version'].to_i
when 5
yum_repo = node['ambari']['rhel_5_repo']
when 6
yum_repo = node['ambari']['rhel_6_repo']
end
remote_file "/etc/yum.repos.d/ambari.repo" do
source yum_repo
not_if { File.exists?("/etc/yum.repos.d/ambari.repo") }
end
when "suse"
remote_file "/etc/zypp/repos.d/ambari.repo" do
source node['ambari']['suse_11_repo']
not_if { File.exists?("/etc/zypp/repos.d/ambari.repo") }
end

That worked for me. Let me know if you want me to write that up and submit
a pull request.


Reply to this email directly or view it on GitHub
#2 (comment).

from ambari.

Joseph-R avatar Joseph-R commented on August 18, 2024

Hey JP,

Thanks! Will do.

Regards,
Joe

from ambari.

jp avatar jp commented on August 18, 2024

Thanks for the PR 👍

from ambari.

Related Issues (14)

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.