I'm relatively new to ansible, so apologies if this question misses something.
My goal is to add a line to the ~/.bashrc
file with ansible. I think the best way to do that is with the ansible.builtin.lineinfile
module.
Unfortunately, I've run the module, it appears to run properly on the target host machine, reports back 'changed'
on the first run (and 'ok'
on subsequent runs), but no changes are actually made in the ~/.bashrc
file.
Appreciate any help in figuring out what changes would be needed to create the desired outcome.
---
- hosts: setup
become: true
vars_files:
- /etc/ansible/vars.yml
tasks:
- name: Test lineinfile
ansible.builtin.lineinfile:
path: ~/.bashrc
line: "test lineinfile"