Simple Per-User Bash Profile Configuration
While creating Ansible scripts to automate the configuration of servers, I frequently stumble across an issue where I need to setup a user’s profile on the server that has a custom path. The issue that arises is that the .bash_profile file is a single file where any number of PATH exports can be provided. Any step in a provisioning tool like Ansible should be aware that this only adds state. I have seen other DevOps workers use modules like lineinfile, which I abhor because you can never be certain that the module will work. You will always ask yourself, “did the PATH on line 5 get set correctly, or did someone change one character (or perhaps add a comment) that now breaks the lineinfile module task?” ...