Hi@akhtar,
You need to write one program file in the YML language. Ansible Playbooks works on the YML language. I have attached one playbook below for your reference.
- hosts: all
tasks:
- package: "name=httpd state=present"
- copy: "src=home.html dest=/var/www/html/"
- service: "name=httpd state=started"
You have to run ansible-playbook command as shown below.
$ansible-playbook hello.yml
PLAY [all] *************************************************************************************************************************************************************
TASK [Gathering Facts] *************************************************************************************************************************************************
ok: [192.168.0.179]
TASK [package] *********************************************************************************************************************************************************
ok: [192.168.0.179]
TASK [copy] ************************************************************************************************************************************************************
ok: [192.168.0.179]
TASK [service] *********************************************************************************************************************************************************
ok: [192.168.0.179]
PLAY RECAP *************************************************************************************************************************************************************
192.168.0.179 : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0