Ansible Module copy: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 10: Line 10:


<syntaxhighlight lang='yaml'>
<syntaxhighlight lang='yaml'>
- name: Copy .envrc script
- name: Copy bashrc scripts
   template:
   template:
     src: envrc
     src: "{{ item }}"
     dest: "{{ ansible_env.SOME_DIR }}/.envrc"
     dest: "{{rc_d}}"
     mode: "u=rw,g=r,o=r"
     mode: "u=rwx,g=rx,o=rx"
  with_fileglob:
    - "*.sh"
</syntaxhighlight>
</syntaxhighlight>



Revision as of 18:42, 19 January 2021

External

Internal

Example

- name: Copy bashrc scripts
  template:
    src: "{{ item }}"
    dest: "{{rc_d}}"
    mode: "u=rwx,g=rx,o=rx"
  with_fileglob:
    - "*.sh"

The files can be placed in:

  • <role>/files