ansible localhost -m ping
for same system
ansible localhost -m command "date"
- command module dodes not support
|,>>
shell
module understand everythingping
moduleyum
moduleansible localhost -m service -a "name=httpd state=started"
when we want to start services- (yum,service,shell,copy)------->file---->its called playbook ------> language for it
yaml
- playbok have three section
- Target(group)
- Variable(optional)
- Task (module)
- start wit
---
- give a space
kk
- fxn with name
- fxn without name(its called lambda)
- function
def
fxn
def hell() : print ()
- Dynamic fxn
def hell(x,y) :
its take only two input- if wants to give input outside of fxn then import
sys
module print(sys.argv)
will print inline inputdef hell(*x)
its take the all input its a tuple