cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Starfighter Starfighter
Starfighter
  • 2,617 Views

Ansible Modules

Jump to solution

Hello all,

Me again.  Got another query about something that is even more disturbing than my query from the previous post.

In this document that I'm reading about some fundamental Ansible concepts, the following snippet is provided:

- name:  Install apache packages
       yum:    name=httpd    state=present


This document is suggesting that  -name  and  yum  are modules.  Now, I'm good with yum being referred to as a module.  I can verify this with the classic "ansible-doc -l" command.  However, with the context of "- name", I'm not seeing how that can be a considered a module. Not only due to the context am I thinking that this is incorrect, but nowhere does "name" appear in the output of "ansible-doc -l".   

I anxiously await your reply.  I'm thinking it may be time to jettison this resource that I'm reading from.  

Thanks in advance for your response(s).

 

Trevor "Red Hat Evangelist" Chandler
Labels (1)
0 Kudos
2 Solutions

Accepted Solutions
matteoclc
Flight Engineer
Flight Engineer
  • 2,594 Views

Hello again,
and again you are right:

yum is the module
name is your arbitrary task name
And that way of defining module argument is going to be deprecated

- name: Install apache package
  yum:
    name: httpd
    state: present

Ciao

--
Matteo Calcagnini

View solution in original post

matteoclc
Flight Engineer
Flight Engineer
  • 2,586 Views
Pay attention to indentation

- name: install Apache package
__yum:
____name: httpd
____state: present
--
Matteo Calcagnini

View solution in original post

4 Replies
matteoclc
Flight Engineer
Flight Engineer
  • 2,595 Views

Hello again,
and again you are right:

yum is the module
name is your arbitrary task name
And that way of defining module argument is going to be deprecated

- name: Install apache package
  yum:
    name: httpd
    state: present

Ciao

--
Matteo Calcagnini
matteoclc
Flight Engineer
Flight Engineer
  • 2,587 Views
Pay attention to indentation

- name: install Apache package
__yum:
____name: httpd
____state: present
--
Matteo Calcagnini
Trevor
Starfighter Starfighter
Starfighter
  • 2,497 Views

Thank you for confirming that the information that I read was in error.  

I was bothered about the reference to "name" being a module, I didn't even want to say anything about the indentation.  I've certainly had a few experiences already to see how critical indentation is.

Again, many, many thanks for the reply.

Trevor "Red Hat Evangelist" Chandler
0 Kudos
Trevor
Starfighter Starfighter
Starfighter
  • 2,494 Views

Many thanks for the confirmation.  Also, thank you for the announcement about the eventual deprecation of that syntax used to define the module argument.  

Trevor "Red Hat Evangelist" Chandler
0 Kudos
Join the discussion
You must log in to join this conversation.