Ansible Module copy

From NovaOrdis Knowledge Base
Revision as of 18:10, 19 January 2021 by Ovidiu (talk | contribs) (→‎Internal)
Jump to navigation Jump to search

External

Internal

Example

- name: Copy .envrc script
  template:
    src: envrc
    dest: "{{ ansible_env.SOME_DIR }}/.envrc"
    mode: "u=rw,g=r,o=r"
- 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>/templates