Ansible - Debug module

1 - About

debug module

3 - Example

3.1 - Ad hoc

With the ansible command line

Example to get the ansible_host value


ansible -i inventory.yml -m debug -a var=ansible_host all

where:

Output:


vps | SUCCESS => {
    "ansible_host": "server01.example.com"
}

3.2 - One variable


tasks:
    - debug:
        var: test

3.3 - Several variable


tasks:
    - debug:
        var: item
      with_items: 
        - "{{ var1 }}"
        - "{{ var2 }}"

3.4 - Message


- name: 'Installation notes'
   vars:
      msg: |
        The installer is installed here:
             /tmp/install.dir.XXXXX/temp.lax
        A silent install command is started you can check it with the following command
            ps -ef | grep -i silent

        Logs can be found at
          * install log: /opt/informatica/1022/Informatica_10.2.2_Services_2019_08_28_15_52_09.log,
          * Console Redirections at install.log,
          * Error log are at /home/infa/silentErrorLog_....

        The silent installation is complete when the ervices_InstallLog<timestamp>.log file is created in the installation directory.

        The whole installation should not take more than 15 minutes.
    debug:
      msg: "{{ msg.split('\n') }}"


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap