How to install httpd web server in remote node using Ansible

0 votes

Hi Guys,

I am new in Ansible. I want to install httpd web server in the remote node. How can I do that using Ansible command?

Jul 29, 2020 in Ansible by akhtar
• 38,180 points
681 views

1 answer to this question.

0 votes

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"
    ]
}

answered Jul 29, 2020 by MD
• 95,240 points

Related Questions In Ansible

0 votes
1 answer

How do I wget a file from web server using shell in the ansible playbook

Hey Ayaan, you could probably use this ...READ MORE

answered Jan 24, 2019 in Ansible by Anushri
2,411 views
0 votes
1 answer

How to copy files in remote system using Ansible?

Hi@akhtar, You need to use the copy module ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,240 points
292 views
0 votes
1 answer

How to overwrite the content of a file in remote systems using Ansible playbook?

Hi@akhtar, You can find one argument in the ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,240 points
3,925 views
0 votes
1 answer

How to find the memory of remote systems using the setup module in Ansible?

Hi@akhtar, You need to use the setup module to ...READ MORE

answered Aug 10, 2020 in Ansible by MD
• 95,240 points
1,378 views
+1 vote
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,191 views
0 votes
1 answer

How to start httpd service in a remote system using Ansible?

Hi@akhtar, Ansible has a module named service. This ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,240 points
641 views
0 votes
1 answer

How to configure httpd web server using Ansible Playbook?

Hi@akhtar, You need to write one program file ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,240 points
491 views