- name: backup bash.bashrc for debian/ubuntu (no check mode) ansible.builtin.shell: executable: /bin/bash cmd: "[[ ! -f /etc/bash.bashrc.dist ]] && cp -i /etc/bash.bashrc /etc/bash.bashrc.dist && echo changed || true" register: result changed_when: >- 'changed' in result.stdout - name: blockinfile_bashrc for debian/ubuntu ansible.builtin.blockinfile: path: /etc/bash.bashrc block: "{{ lookup('file', 'templates/blockinfile_bashrc') }}" prepend_newline: true append_newline: true diff: true - name: helper scripts for debian/ubuntu ansible.builtin.copy: src: templates/log_debian dest: /root/log mode: 0700 diff: true