fourforbusiness.copy-files

Ansible Role: Copy Files

Build Status Ansible-Galaxy License: MIT

Ensures files and templates exist on the target machine.

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

project_files
A list of files and/or templates to copy, each file has to have the properties

  • src (string)
  • dst (string)
  • mode (symbolic and octal form)
  • force (if the file should be overwritten if it already exists)

Dependencies

None.

Example Playbook

- hosts: all
  become: yes
  vars_files:
    - vars/main.yml
  roles:
    - fourforbusiness.copy-files

Inside vars/main.yml:

---
template_var: 'I am a text.'
project_files:
  files:
    - src: "example.txt"
      dst: "~/example.txt"
      mode: '0755'
      force: false
  templates:
    - src: "example_template.txt.j2"
      dst: "~/example_from_template.txt"
      mode: '0755'
      force: false

License

MIT / BSD

Author Information

This role was created in 2018 by four for business AG.

About

Copies files and templates to the target machine

Install
ansible-galaxy install fourforbusiness.copy-files
GitHub repository
License
mit
Downloads
914
Owner