Trevor
Starfighter Starfighter
Starfighter
  • 435 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
  • 412 Views

Re: Ansible Modules

Jump to solution

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

Reply
Loading...
matteoclc
Flight Engineer
Flight Engineer
  • 404 Views

Re: Ansible Modules

Jump to solution
Pay attention to indentation

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

View solution in original post

Reply
Loading...
4 Replies
matteoclc
Flight Engineer
Flight Engineer
  • 413 Views

Re: Ansible Modules

Jump to solution

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

Reply
Loading...
matteoclc
Flight Engineer
Flight Engineer
  • 405 Views

Re: Ansible Modules

Jump to solution
Pay attention to indentation

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

View solution in original post

Reply
Loading...
Trevor
Starfighter Starfighter
Starfighter
  • 315 Views

Re: Ansible Modules

Jump to solution

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
Reply
Loading...
Trevor
Starfighter Starfighter
Starfighter
  • 312 Views

Re: Ansible Modules

Jump to solution

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
Reply
Loading...
Join the discussion
You must log in to join this conversation.