I would expect this to be pretty simple. I\'m using the lineinfile module like so:
- name: Update bashrc for PythonBrew for foo user
lineinfil
Apparently ansible has matured and now (version >2.4.0) according to the documentation, The defaults when only the line is specified will append a given line to the destination file:
- name: Update bashrc for PythonBrew for foo user
lineinfile:
dest: /home/foo/.bashrc
line: "[[ -s ${pythonbrew.bashrc_path} ]] && source {pythonbrew.bashrc_path}"
owner: foo