Hi@akhtar,
You need to use the package module in Ansible. It allows you to install any software in a remote system. You can use the below-given command.
[root@localhost ~]# ansible all -m package -a "name=httpd state=present"
192.168.0.179 | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Installed: httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64",
"Installed: mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64",
"Installed: httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch",
"Installed: apr-1.6.3-9.el8.x86_64",
"Installed: httpd-tools-2.4.37-10.module+el8+2764+7127e69e.x86_64",
"Installed: redhat-logos-httpd-80.7-1.el8.noarch",
"Installed: apr-util-1.6.1-6.el8.x86_64",
"Installed: apr-util-bdb-1.6.1-6.el8.x86_64",
"Installed: apr-util-openssl-1.6.1-6.el8.x86_64"
]
}