Coder Social home page Coder Social logo

Comments (6)

sethvargo avatar sethvargo commented on August 12, 2024

@mattupstate what version of this cookbook? What does your recipe look like? What is the diff of your /etc/hosts pre and post converge?

from hostsfile.

mattupstate avatar mattupstate commented on August 12, 2024

Version is 2.4.0. Hypothetically, my recipe looks like this:

hosts = {
   'log.org.internal' => '127.0.0.1',
   'api.org.internal' => 'XXX.XXX.XXX.XXXX'
}

hosts.each do |hostname, ipaddress|
  hostsfile_entry hostname do
    ip_address ipaddress
    hostname hostname
    action :create
  end
end

The entry for api.org.internal is entered, but the entry for log.org.internal never gets entered. I'm also not getting a diff from chef-client run. However, I can tell you if I add the entry, manually, with a priority comment to look like other entries, it gets removed upon another chef-client run.

from hostsfile.

sethvargo avatar sethvargo commented on August 12, 2024

I think you need to use append in this case, because 127.0.0.1 already exist.

from hostsfile.

mattupstate avatar mattupstate commented on August 12, 2024

Failed to mention, append does nothing to help. I honestly feel really stupid here...as if I'm just making a bad mistake and wasting your time. I apologize if this ends up being the case!

from hostsfile.

sethvargo avatar sethvargo commented on August 12, 2024

I think you're either:

  • Hitting some special edge case with 127.0.0.1

or

  • Have something else further in your run that is removing the entry you create.

from hostsfile.

mattupstate avatar mattupstate commented on August 12, 2024

Thanks for the input, I'll see what I can figure out. Thought it could be more obvious. Sorry for wasting your time.

from hostsfile.

Related Issues (20)

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.