Automation with Power

Power Business Continuity and Automation

Connect, learn, and share your experiences using the business continuity and automation technologies and practices designed to ensure uninterrupted operations and rapid recovery for workloads running on IBM Power systems. 


#Power
#TechXchangeConferenceLab


#Servers
 View Only
  • 1.  What's the difference between modules and roles?

    Posted 01/30/24 10:28 AM
    Edited by Linda Alkire 02/02/24 09:12 AM

    Could someone help me understand the difference between a module and a role in the context of Ansible Automation Platform?



    ------------------------------
    Linda Alkire
    IBM
    Minneapolis MN
    ------------------------------


    #ansible-on-power


  • 2.  RE: What's the difference between modules and roles?

    Posted 02/13/24 09:10 AM

    Modules: Ansible tasks contain a name, a module and parameters for the module. In the following example, the "ansible.builtin.debug" module is used and this is documented here. In the background, Ansible executes Python code to execute the defined task.

    - name: Display message                 # Name
      ansible.builtin.debug:                # Module
        msg: "This is a test message."      # Parameter

    Roles: Useful to bundle Ansible tasks and with many functions like handlers (special form of ansible tasks that are executed towards the end of a role in certain conditions) to structure tasks.

    Playbook: Top-level structure which is executed by Ansible and executes roles on defined hosts.



    ------------------------------
    Niklas
    System Engineer UNIX and Linux on Power
    ------------------------------