Trying to execute bash script using Ansible one one node

0 votes

I have a bash script that I need to execute one of my nodes using ansible

- name : execute the script for uploading www files
  shell: /root/upload_www.sh

I end up with this error:

ssh -t -o StrictHostKeyChecking=no -i $key user@$kavya "sudo rsync -kavya \"ssh -o StrictHostKeyChecking=no -i $key\" /var/www/html user@$source:/var/www/"
Jan 28 in Ansible by Omkar
72 views

1 answer to this question.

0 votes

You could make your task an asynchronous action by adding the async: "{{ max_wait_time }}"option:

- name : execute the script for uploading www files
  shell: /root/upload_www.sh
  async: 10800 
  poll: 300 
answered Jan 28 by Kavya

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

Ansible playbbok to copy files from one node to another remote node

You can create a playbook for copying ...READ MORE

answered Jan 16 in Ansible by Danica
439 views
0 votes
1 answer

Ansible playbook for moving files from one node to another remote node

The best way to do this is: copy ...READ MORE

answered Jan 16 in Ansible by Nigya

edited Jan 18 by Vardhan 1,214 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
208 views
0 votes
1 answer
0 votes
1 answer

Execute a command using ansible playbook

Hey @Reshma, You can use the URI ...READ MORE

answered Jan 17 in Ansible by Sameer
253 views
0 votes
1 answer

Is it possible to run an Ansible Playbook in python script?

Hey @Cerci, Of course its possible. You ...READ MORE

answered Jan 17 in Ansible by Nicolas
2,624 views