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

  • Home
  • SEARCH
  • 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 8875047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:52:45+00:00 2026-06-14T18:52:45+00:00

In Chef I have an array that I would like to print out comma

  • 0

In Chef I have an array that I would like to print out comma separated, but I would also like to make sure that each of the values exist in another array. Is there a simple one line way of both printing out the array and also validating the contents. In the past I’d done

The current printing only line:

hostgroups <%= n.run_list.roles.to_a.join(",") %>
  • 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-14T18:52:46+00:00Added an answer on June 14, 2026 at 6:52 pm

    I’d do it like this:

    hostgroups <%= (n.run_list.roles.to_a & another_a).join(",") %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below my code for installing vcider. I am learning chef but have not seen
So I have written an XQuery to find out how many times each of
I have been using Chef to manage our servers. My roles/app.rb looks like this:
I am trying to configure my Vagrant file to have some chef attributes, but
I have model data that came from a MultipleChoiceField. I have figured out it
I use vagrant to test my chef recipes. The issue is that I have
I have an environment ( Graphite ) that looks like the following: N worker
I've got a resource in a chef recipe that I'd like to be optional.
I have a server managed by Chef. I need to access some values that
I am new to chef and I have a question regarding the following. I

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.