# - similar to '02-playbook-copy-bash-configs.yml' but uses 'vars_files' # to store the variable 'prefix_dir' inside files representing # the environment --- - name: "05 - custom ansible - copy bash config files w/ content" hosts: localhost connection: local vars_files: - [ "vars/{{ inventory_hostname }}.yml", "vars/otherhosts.yml" ] tasks: - name: copy '.bash_aliases' ansible.builtin.copy: src: ~/repos/ansible_repo/ansible-practice/system/.bash_aliases dest: "{{ prefix_dir }}.bash_aliases" mode: '0644' tags: ['bash_aliases'] - name: Creating '.bashrc' file with content ansible.builtin.copy: src: ~/repos/ansible_repo/ansible-practice/system/.bashrc dest: "{{ prefix_dir }}.bashrc" mode: '0644' tags: ['bashrc'] - name: Creating '.bash_profile' file with content ansible.builtin.copy: src: ~/repos/ansible_repo/ansible-practice/system/.bash_profile dest: "{{ prefix_dir }}.bash_profile" mode: '0644' tags: ['bash_profile']