ahrenstein / chefcookbook-public-linuxtweak

Removes Landscape garbage from Ubuntu systems, tweaks system-wide bashrc settings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chef Cookbook - Linux Tweak

This Chef recipe will perform a few tweaks on linux systems, and a few Ubuntu specific tweaks on Ubuntu systems.

DEPRECATION WARNING

I am no longer maintaining this Chef cookbook as I have started working with Ansible instead. I don't have an Ansible version of this cookbook at this time though, and I may never make one since the tweaks contained are highly preferential and easy to reproduce using your own Ansible workflow. I will still accept pull requests against this cookbook if improvements are made to it though.

Tweaks Performed

  1. Added EPEL repos (rhel-based systems only)
  2. Remove the following packages;
  3. puppet (Since we are using Chef)
  4. landscape-client-ui (Ubuntu only)
  5. landscape-client-ui-install (Ubuntu only)
  6. landscape-client (Ubuntu only)
  7. landscape-common (Ubuntu only)
  8. apparmor (Ubuntu only)
  9. ufw (Ubuntu only)
  10. Install some packages I commonly use
  11. vim
  12. curl (For some reason not always present on base systems)
  13. gnupg2 (I use gpg2 a lot)
  14. atop
  15. bmon (Not on rhel-based systems)
  16. git
  17. bash (FreeBSD 10 has this missing by default)
  18. Add some custom bash settings for all users
  19. Add aliases for ls -lh and ls -lhtr
  20. Add an alias to change rm into rm -i
  21. Added an alias so "ssh" becomes "ssh -A"
  22. Added an alias so "root" becomes "ssh -A -lroot"
  23. Change the history so it maintains 5000 entries and have date/time stamps
  24. Export a nice bash PS1
  25. Export vim as the default editor
  26. Delete the .bashrc for root and uids 500-900 (Except on FreeBSD)
  27. Replace the .bashrc and .bash_profile for root (FreeBSD only)

Requirements

  1. Chef (Tested on Chef 12)
  2. 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)
  3. The line cookbook from Chef Supermarket
  4. The apt cookbook from Chef Supermarket
  5. The yum-epel cookbook from Chef Supermarket

Installation Tips

  1. 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

  1. 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.
  2. 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

  1. v0.3.5
  2. Repo URL change
  3. v0.3.4
  4. Deprecation of cookbook
  5. v0.3.3
  6. Deprecation warning added to README
  7. v0.3.2
  8. Added ufw to the list of packages to remove
  9. v0.3.1
  10. For FreeBSD servers deploy the root user's bashrc to both .bashrc and .bash_profile so SSH will source it properly
  11. Added aliases for "ssh" and "root"
  12. v0.3.0
  13. Adding FreeBSD support
  14. Dropping testing for Ubuntu 12.04. (It may still work, but there are no guarantees)
  15. Changed a few minor things regarding to OS filtering when it comes to deploying certain tweaks.
  16. v0.2.9
  17. Kitchen is now using new boxes due to Chef.IO discontinuing some of them
  18. Removed random .DS_Store files that snuck in to a commit
  19. v0.2.8
  20. Remove apparmor from Ubuntu systems
  21. Testing against Ubuntu 15.04 has been added
  22. The bash PS1 is now an environment variable
  23. v0.2.7
  24. Added dependency on yum-epel from Supermarket for installing git, atop, and bmon from EPEL repo on rhel-based systems
  25. Removed line cookbook version requirement
  26. Remove Puppet if installed since we use Chef (Assists with migrations from Puppet to Chef)
  27. Make sure atop is installed
  28. Make sure bmon is installed on non-rhel systems
  29. Make sure git is installed
  30. v0.2.6
  31. Changed the range of UIDs bashrc is customized for to be 500-2000
  32. v0.2.5
  33. CentOS users were not sourcing the /etc/bashrc automatically. This was fixed
  34. v0.2.4
  35. 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.

About

Removes Landscape garbage from Ubuntu systems, tweaks system-wide bashrc settings

License:GNU Affero General Public License v3.0


Languages

Language:Ruby 99.0%Language:HTML 1.0%