Is it possible to run commands on ansible host?

0 votes
Is it possible to run commands on ansible host?
Jan 9 in Ansible by Anjali
47 views

1 answer to this question.

0 votes

If you just trying to run a single task locally on your ansible host then just specify a parameter called local_action

Something like this:

 name: example
  hosts: webservers
  tasks:
  - name: check out a git repository
    local_action: git repo=git://ansible.example.org/path-to-repo dest=/local/path
answered Jan 9 by Vijay

Related Questions In Ansible

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
1,203 views
0 votes
1 answer

Running ansible command on a single server when it is deployed to multiple servers

You can try the run_once attribute: Example from ...READ MORE

answered Jun 13, 2018 in Ansible by DareDev
• 6,810 points
122 views
0 votes
1 answer
0 votes
3 answers
+13 votes
2 answers
0 votes
1 answer
+1 vote
1 answer

Is it possible to append a large amount of text to a file using Ansible?

Here is concept which you can follow. blockinfile is ...READ MORE

answered Jul 30, 2018 in Ansible by Atul
• 10,240 points
1,879 views
0 votes
1 answer

Is it possible to run a playbook with a crontab?

Ofcourse you can run ansible playbook with ...READ MORE

answered Jan 17 in Ansible by Yesha
177 views