This cookbook provides a simple bashrc_manager
LWRP.
It create multiple files in bashrc.d folder and merge them into bashrc file without loosing any local existing version.
This cookbook was heavily influenced by the bash cookbook.
Just add bashrc_manager
to your cookbook dependency list.
- Chef 12.5
- Linux Distro (Tested on CentOS, Debian, Amazon, & Ubuntu)
bashrc_manager
: does the init/setup/parse/merge process. This LWRP will create bashrc.d folder if not present.
If an existing bashrc 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.
add:
(default) - add a specified file to bashrc.d folder and merge all files from this folder to given user bashrc file.remove:
- remove a specified file from bashrc.d folder.
-
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.
bashrc_manager 'profile.addin' do
user 'jdoe'
content "PATH=/home/jdoe/my_bin:$PATH"
end
Includes basic chefspec support and matchers.
bundle install
rspec
Author:: Table XI ([email protected])