Running command using Ansible


How can I run this command using ansible or by creating a playbook. 

bash <(curl -Ss all

Thanks for your help. 

  • post-author-pic
    Ali M

    Hi A J,

    You could use the shell module to execute that command:

    ansible all -m shell -a "curl -Ss"

    For playbook, feel free to have a look at the samples provided for the shell module:

  • post-author-pic
    A J

    I already tried that solution, it did not work. It throws timeout. 

  • post-author-pic
    Piotr N

    Maybe this playbook helps: 

    - hosts: all
    become: True
    - name: Get script
    dest: /tmp/
    mode: 0755

    - name: Exec
    script: /tmp/ --non-interactive all
    executable: bash

  • post-author-pic
    Ali M

    Hi A J,

    I was able to successfully download that shell script using the command provided in my earlier comment. 

    You are getting a time out error, which is not related to the syntax of the ansible command but rather with the ansible control machine's connectivity to the hostname  or to one of the inventory machines. So please check for issues around both.

    Additionally, I would recommend you to paste the error here which  is being returned to you, so that we can try helping you further.

Looking For Team Training?

Learn More