Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.
/ chef-bash Public archive
forked from guilhem-cookbooks/bash

Chef cookbook to manage bash {profile, bashrc}

License

Notifications You must be signed in to change notification settings

Roblox/chef-bash

 
 

Repository files navigation

bash cookbook

Build Status

This cookbook provides a simple bash_profile LWRP.

It create multiple files in bash_profile.d folder and merge them into bash_profile file without loosing any local existing version.

Obviously, it works only on Linux platform.

Usage

Just add bash to your cookbook dependency list.

Requirement

N/C

Resource / Provider

  • bash_profile : does the init/setup/parse/merge process. This LWRP will create bash_profile.d folder if not present.

If an existing bash_profile file exists in user home folder, it will be saved in a permanent init file at the very first run and then will be merged each time LWRP is called.

Action

  • add: (default) - add a specified file to bash_profile.d folder and merge all files from this folder to given user bash_profile file.
  • remove: - remove a specified file from bash_profile.d folder.

Attributes

  • filename - name of the file

  • user - user to interact with. Group and home folder will be automaticly resolved from system informations.

  • content - String to be set on the new profile file. It easily works with simple string, multiline string, or strings loaded from a file.

Syntax

bash_profile 'profile.addin' do
  user 'jdoe'
  content "PATH=/home/jdoe/my_bin:$PATH"
end

Testing

Includes basic chefspec support and matchers.

  1. bundle install
  2. rspec

Author

Author:: Guilhem Lettron (guilhem.lettron@optiflows.com)

About

Chef cookbook to manage bash {profile, bashrc}

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 96.4%
  • Shell 3.6%