Friday, 9 August 2019

Ansible service Modules by Raj Gupta

Service Modules:- This is used to start and stop the service.

[ansible@ip-172-31-95-179 ~]$ vi service.yml
[ansible@ip-172-31-95-179 ~]$ cat service.yml
-
  name: "this is our first playbook."
  hosts: all
  tasks:
    -
      name: "create a dummy file on websever1"
      service:
        name: httpd
        state: started
[ansible@ip-172-31-95-179 ~]$ ansible-playbook service.yml -i inventory.txt

No comments:

Post a Comment