On 3/17/20 8:05 AM, Shifa Shaikh wrote:
> Here is my playbook:
>
> cat test.yml
>
> |
> -name:Play2
> hosts:targetserver
> tasks:
>
> -copy:src=./centosscript.sh dest=~mode=775
> -shell:~/centosscript.sh
> |
>
>
> Here is my shell script:
>
> cat centosscript.sh
> |
> #/bin/ksh
>
Here is my playbook:
cat test.yml
- name: Play 2
hosts: targetserver
tasks:
- copy: src=./centosscript.sh dest=~ mode=775
- shell: ~/centosscript.sh
Here is my shell script:
cat centosscript.sh
#/bin/ksh
grabip=`ip r | grep kernel`
I also tried
grabip=`ifconfig | grep inet`