Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:02:08+00:00 2026-06-03T01:02:08+00:00

I have a server managed by Chef. I need to access some values that

  • 0

I have a server managed by Chef.
I need to access some values that live in a cookbook data bag from scripts not run by Chef.

/* Chef REST API allows to access data bag values as seen by Chef server. This is not what I want. Each chef-client run may introduce a number of coordinated changes, including changes in the data bag. If data on the server had already changed but chef-client did not run locally yet, local setup and server-side data bag may be out of sync. */

I see two solutions:

  • Parse/import the data bag file under /var/cache/chef/cookbooks/<book-name> since it’s more or less normal Ruby.
  • Inside a recipe, dump relevant data from the data bag into a plain file accessible from my scripts.

Are there better options?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:02:10+00:00Added an answer on June 3, 2026 at 1:02 am

    Dumping data from the node hash or data bags into a separate file is a good way of communicating between the Chef server and scripts running on a node. If your script can parse JSON then it’s really easy:

    file "/etc/script.json" do
      owner "root"
      group "root"
      mode 0644
      content node[:whatever].to_json
     end
    

    Using the Chef REST interface sounds like overkill, and groping around in /var/cache/chef is just rude. (-:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have configuration data (the host/post for a Redis server) that is managed by
We have a dev server that has managed to become indexed by Google. Page
I have managed to insert the whole text-file data in SQL-SERVER database table with
i have managed to make a NTP request and retrieve the server time from
I have a web page driven by data taken from an Exchange server using
We have a weblogic server 10.0 instance which has a cluster with one managed
I have managed to successfully deploy my Symfony2 application to a production web server,
I have finally managed to get javan-whenever gem working on my site5 server, and
i need to connect to another server we manage and have it's results (in
I have a instance of Oracle Access Manager set up on Server A and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.