How to start httpd service in a remote system using Ansible

0 votes

Hi Guys,

I have httpd web server in a remote system. I want to start its service. How can I do that using Ansible?

Jul 29, 2020 in Ansible by akhtar
• 38,170 points
368 views

1 answer to this question.

0 votes

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",

answered Jul 30, 2020 by MD
• 95,040 points

Related Questions In Ansible

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,040 points
2,232 views
0 votes
2 answers

How to create a directory in remote nodes using Ansible-Playbook?

You can read install and setup apache ...READ MORE

answered Aug 23, 2020 in Ansible by anonymous
• 160 points
239 views
0 votes
1 answer

How to disable swap in remote system using Ansible?

Hi@akhtar, You can use the mount module in ...READ MORE

answered Sep 16, 2020 in Ansible by MD
• 95,040 points
972 views
0 votes
1 answer

How to move/rename a file using an Ansible task on a remote system?

Hi@akhtar, You can use the command module to ...READ MORE

answered Sep 17, 2020 in Ansible by MD
• 95,040 points
4,447 views
+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
963 views
+2 votes
1 answer
0 votes
1 answer

How to install httpd web server in remote node using Ansible?

Hi@akhtar, You need to use the package module in Ansible. ...READ MORE

answered Jul 29, 2020 in Ansible by MD
• 95,040 points
468 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,040 points
222 views