How to give a task name in Ansible

0 votes

Hi Guys,

I have created one Ansible Playbook. This playbook contains three tasks. I want to give the task name so that I can see at the time of running the playbook. How can I do that?

Aug 2, 2020 in Ansible by akhtar
• 38,260 points
5,947 views

1 answer to this question.

0 votes

Hi@akhtar,

You can give the task name in your Ansible Playbook. Inside the task module, you will find one argument called name. This is used to give the task name. When you run your playbook you can able to see task name. I have attached one example for your reference below.

- hosts: all
  vars:
    - pname: "httpd"
  tasks:
  - name: Install httpd module
    package:
      name: "{{ pname }}"
      state: present
    register: x
  - debug:
      var: x.failed
answered Aug 2, 2020 by MD
• 95,460 points

Related Questions In Ansible

0 votes
1 answer

How to skip execution of a task in ansible playbook ??

Define tags...  Then while running playbook use --skip-tags. READ MORE

answered Sep 30, 2020 in Ansible by Adil
10,824 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,460 points
3,369 views
0 votes
1 answer

How to create a group of Managed Nodes in Ansible?

Hi@akhtar, You can use tags in your inventory ...READ MORE

answered Aug 1, 2020 in Ansible by MD
• 95,460 points
1,270 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,460 points
14,404 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 votes
1 answer
0 votes
1 answer

How to capture the output of a task in Ansible Playbook?

Hi@akhtar, Ansible registers module used to capture/store the ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,460 points
15,048 views
0 votes
1 answer

How to run a playbook from a specific task in Ansible?

Hi@akhtar, The --start-at-task option allows you to start ...READ MORE

answered Sep 15, 2020 in Ansible by MD
• 95,460 points
11,165 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP