Ansible - Shell

Table of Contents

About

This article shows how to execute a command via a shell with ansible.

Example

- name: Move file
  become: yes
  become_user: "{{ prometheus_user_name }}"
  shell:
    cmd: "/bin/cp {{ prometheus_install_dir }}/{{ prometheus_node_exporter_name }}/* {{ prometheus_home }}"

Powered by ComboStrap