Ansible - Shell
Table of Contents
About
This article shows how to execute a command via a shell with ansible and the ansible shell module 1)
Example
- name: Move file
become: yes
become_user: "{{ prometheus_user_name }}"
shell:
cmd: "/bin/cp {{ prometheus_install_dir }}/{{ prometheus_node_exporter_name }}/* {{ prometheus_home }}"
args:
executable: /bin/bash