Hi All,
I have a requirement to login to multiple application servers and just run
different scripts individually on different servers
Rather than creating task for each server - I would like to just create one
task with name of the shell script in a variable
How can we implement this
Eg :
====inventory file===
[APP]
host1.example.com path=/home/app script=start.sh
host2.example.com path=/home/app2 script=echo y | start_app.sh
===YAML file===
---
- hosts: APP
remote_user: app
tasks:
- name: START APP
shell: |
cd "{{ path }}"
"{{ script }}"
register: result
tags: check
- debug: msg="{{ result.stdout }}"
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f51c6b12-6a79-429f-93df-e2775f1a448d%40googlegroups.com.