Comments on Ansible Guide: The Ad-Hoc Command

The Ad-Hoc command is the one-liner ansible command that performs one task on the target host. It allows you to execute simple one-line task against one or group of hosts defined in the inventory file configuration.

5 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Husain

Hi Arul, Thanks for useful info. nice article!

What is "hakase-testing" in the command.

Husain.

By: jgatica

hola que tal Husain "hakase-testing" es un archivo en cual esta las ip de los servidores que esta automatizando es lo mismo que "hosts", SLDS

By: New Devops learner

Thanks Bro

This is a better Stuff for Strarting Ansible Thanks a Lot

By: Fayaz Rehman

Good job ! Keep it up.

By: Vivek Gaur

My code to stop and start a service ssh is(main.yml file):

 

- name: Stop and Start Service

  hosts: localhost

  tasks:

  - name: Stop ssh

    service:

      name: ssh

      state: stopped

      enabled: yes

 

  - name: Started ssh

    service:

      name: ssh

      state: started

      enabled: yes

 

But I am not able to succeed in passing the test case. Anybody please help.

 

Mail: [email protected]