Skip to content

Generates profile.d scripts based on Chef attributes.

License

Notifications You must be signed in to change notification settings

MelonSmasher/chef_profiled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chef_profiled

Manages profile.d scripts through Chef attributes.

Usage

chef_profiled::default

Just include chef_profiled::default in your node's run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[chef_profiled]"
  ]
}

Attributes

Note: see attributes/ for all attributes.

Scripts:

An array of script entries to place in /etc/profile.d. Each script should have an array of lines.

Default Value:

  • []

Ruby usage:

node['chef_profiled']['scripts'] = [
  'testscript' => [
    'export SOMEVAR = "SOMEVAL";',
    'export SOMEVAR2 = "SOMEVAL2";'
  ]
]

JSON usage:

{
  "chef_profiled": {
    "scripts": {
      "testscript": [
        "export SOMEVAR = \"SOMEVAL\";",
        "export SOMEVAR2 = \"SOMEVAL2\";"
      ]
    }
  }
}

Both examples will create the following file: /etc/profile.d/testscript.sh:

export SOMEVAR = "SOMEVAL";
export SOMEVAR2 = "SOMEVAL2";