cookbook 'linux-tweak', '= 0.3.1'
The linux-tweak cookbook has been deprecated
Author provided reason for deprecation:
The linux-tweak cookbook has been deprecated and is no longer being maintained by its authors. Use of the linux-tweak cookbook is no longer recommended.
linux-tweak (15) Versions 0.3.1 Follow0
Performs various tweaks on fresh Linux installs
cookbook 'linux-tweak', '= 0.3.1', :supermarket
knife supermarket install linux-tweak
knife supermarket download linux-tweak
Chef Cookbook - Linux Tweak
This Chef recipe will perform a few tweaks on linux systems, and a few Ubuntu specific tweaks on Ubuntu systems.
Tweaks Performed
- Added EPEL repos (rhel-based systems only)
- Remove the following packages;
- puppet (Since we are using Chef)
- landscape-client-ui (Ubuntu only)
- landscape-client-ui-install (Ubuntu only)
- landscape-client (Ubuntu only)
- landscape-common (Ubuntu only)
- apparmor (Ubuntu only)
- Install some packages I commonly use
- vim
- curl (For some reason not always present on base systems)
- gnupg2 (I use gpg2 a lot)
- atop
- bmon (Not on rhel-based systems)
- git
- bash (FreeBSD 10 has this missing by default)
- Add some custom bash settings for all users
- Add aliases for ls -lh and ls -lhtr
- Add an alias to change rm into rm -i
- Added an alias so "ssh" becomes "ssh -A"
- Added an alias so "root" becomes "ssh -A -lroot"
- Change the history so it maintains 5000 entries and have date/time stamps
- Export a nice bash PS1
- Export vim as the default editor
- Delete the .bashrc for root and uids 500-900 (Except on FreeBSD)
- Replace the .bashrc and .bash_profile for root (FreeBSD only)
Requirements
- Chef (Tested on Chef 12)
- Linux chef-clients (Tested on Ubuntu 14.04, Debian 7.8, CentOS 5.11, CentOS 6.7 and FreeBSD 10 but kitchen will let you test anything you want)
- The line cookbook from Chef Supermarket
- The apt cookbook from Chef Supermarket
- The yum-epel cookbook from Chef Supermarket
Installation Tips
- I personally use Berks to install this into my Chef server, because it's easier.
Attributes
['linux-tweak']['PS1'] allows you to override my bash prompt preferences with your own. It should contain the entire "export PS1=" line, not just the prompt!
Limitations
- This recipe has been tested with Ubuntu 14.04, Ubuntu 15.04, Debian 7.8, CentOS 5.11, CentOS 6.7 and FreeBSD 10 but you can test it with any other Linux distro using kitchen. The full spec test is there.
- Well sort of. I didn't spend the effort to escape the bash PS1 for spec testing so it only tests that the bashrc has a PS1 exported.
Bug Fixes & Changes
- v0.3.1
- For FreeBSD servers deploy the root user's bashrc to both .bashrc and .bash_profile so SSH will source it properly
- Added aliases for "ssh" and "root"
- v0.3.0
- Adding FreeBSD support
- Dropping testing for Ubuntu 12.04. (It may still work, but there are no guarantees)
- Changed a few minor things regarding to OS filtering when it comes to deploying certain tweaks.
- v0.2.9
- Kitchen is now using new boxes due to Chef.IO discontinuing some of them
- Removed random .DS_Store files that snuck in to a commit
- v0.2.8
- Remove apparmor from Ubuntu systems
- Testing against Ubuntu 15.04 has been added
- The bash PS1 is now an environment variable
- v0.2.7
- Added dependency on yum-epel from Supermarket for installing git, atop, and bmon from EPEL repo on rhel-based systems
- Removed line cookbook version requirement
- Remove Puppet if installed since we use Chef (Assists with migrations from Puppet to Chef)
- Make sure atop is installed
- Make sure bmon is installed on non-rhel systems
- Make sure git is installed
- v0.2.6
- Changed the range of UIDs bashrc is customized for to be 500-2000
- v0.2.5
- CentOS users were not sourcing the /etc/bashrc automatically. This was fixed
- v0.2.4
- Alias for l used a pattern match for ll so every time it ran, it would replace ll, and ll would be recreated by its resource. This led to repeating l aliases. This has been fixed.
Use cases
If you like the shell preferences I set (PS1, aliases, etc...) then you can use this module.
Dependent cookbooks
line >= 0.0.0 |
apt >= 0.0.0 |
yum-epel >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Foodcritic Metric
0.3.1 failed this metric
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:20
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:27
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:34
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:41
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:48
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:55
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:62
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:69
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:76
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:83
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:106
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/packages.rb:58
0.3.1 failed this metric
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:27
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:34
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:41
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:48
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:55
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:62
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:69
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:76
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:83
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/bashrc.rb:106
FC002: Avoid string interpolation where not required: /tmp/cook/4067ccc38fc6e13b8095ab2a/linux-tweak/recipes/packages.rb:58