Hi@akhtar,
Ansible has a module named service. This is used to perform service-related tasks. You can use the below command to start httpd service.
[root@localhost ~]# ansible all -m service -a "name=httpd state=started"
192.168.0.179 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"name": "httpd",
"state": "started",
"status": {
"ActiveEnterTimestampMonotonic": "0",
"ActiveExitTimestampMonotonic": "0",
"ActiveState": "inactive",