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 8805525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:53:26+00:00 2026-06-14T01:53:26+00:00

I do apologize prior to asking this dumb question So, my idea is to

  • 0

“I do apologize prior to asking this dumb question “

So, my idea is to have :

  • A chef server
  • N nodes

On each node; i’ll define a basic role; like “NodeRole” which will have apache,php,mysql

Then, i’d like to be able to deploy ‘à la demande’ multiple virtualhosts each containing a full drupal install.

So this new role will have some attributes like :

"username"
"password"
"URL"

When ‘deploying’ this; it will :

- Add an entry to apache virtual host configuration
- Create a user account with provided password
- Create a database user with provided password
- Install drupal with the provided credentials

How can I do this ‘dynamically’ without having to create a txt file each time I want to deploy a new site.

Is it possible to interact with the chef server api and say something like “deploy http://www.example.com john mypassword” ?

Thanks !

  • 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-14T01:53:27+00:00Added an answer on June 14, 2026 at 1:53 am

    Chef is a pull model it’s up to the clients to request their configuration. If you want to push you’ll have to inject something else in to allow you to do that. A command dispatcher which can invoke the client to contact the server when you want.

    If you want to do the same thing over and over it feels like creating a LWRP http://wiki.opscode.com/display/chef/Lightweight+Resources+and+Providers+(LWRP) might be your best bet. You could then pass into it the variables you have and that way the code doesn’t need reproduced X times.

    If you didn’t want to have to create new recipes for each install one other option would be to use the JSON mash capabilites in the attributes object and loop through a collection of objects creating the installs. This way it’s data driven but personally I would look to use different recipes per install as it would probably be more transparent to people viewing the runlist.

    An example of using the attributes mash is shown below. You could acheive this with a databag as well. In this case you could then update the JSON representation in a file and upload with knife or make the changes in the UI. Again I would recommend a recipe per site for transparency but that would lead to code/updating runlists etc

    Your attribute json object would look a bit like this or similar

    "drupal_Sites" : {
        "site1": { "username": "dave", "password" :"password123", "URL":"www.madeup.com" },
        "site2": { "username": "dave2", "password" :"password12", "URL":"www.madeup2.com" }
    }
    

    Then in your recipe it would be something like this

    node["drupal_sites"].each do | site | 
    
    Install = yourdrupalcookbook_InstallResource "#{site['URL']}" do
        username site['username']
        password site['password']
        deploy site['URL']
        action :nothing 
        provider "yourdrupalcookbook_InstallProvider"
    end
    
    Install.run_action(:create)
    

    end

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

Sidebar

Related Questions

I apologize for asking such a dumb question but my linux server is stuck
I apologize for this rather BASIC question, but I am at whits end here!
I apologize if this is a really beginner question, but I have not worked
I apologize if this is a dumb question, but hear me out: Dictionary<string, string>
I apologize if this is a newbie question. I have been working on trying
I apologize for the newb question but have not found a solution online. I
I apologize in advance, if this question doesn't make sense. I'm a newbie. I
I apologize in advance for not knowing how to better state this question. In
I apologize if this a duplicate question (I didn't find anything like that). I'm
I apologize if this question was asked before I just couldn't correctly formalize it.

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.