Ansible - Command
About
command is the default module of the ansible command line and helps you execute adhoc (on the fly) command.
You may also want to check the shell module
Example
A long command
- name: Install | Installing Netdata from {{ netdata_source_dir }} to {{ netdata_prefix }}
command: "{{ command_args|join(' ') }}"
vars:
command_args:
- "./netdata-installer.sh"
- "--install {{ netdata_install_path }}"
- "{{ auto_update_cli_option }}" # Install netdata-updater in cron to update netdata automatically once per day
- "--stable-channel" # fetch and install only the official releases from GitHub
- "--dont-wait" # Run installation in non-interactive mode
args:
chdir: "{{ netdata_source_dir }}"
creates: "{{ netdata_config_file }}" # after installation, the conf file is created
notify: restart netdata
