DevOps Classroom notes 16/Feb/2026

Ansible – facts

give me syntax examples of using ansible facts collected in play book one by one

Ansible conditionals

Lets write a playbook which throws an error when run on Ubuntu

  • lets write a simple playbook
- name: throws an error when run on Ubuntu
  hosts: all
  gather_facts: yes
  become: no
  tasks:
    - name: fail the playbook
      ansible.builtin.fail:
        msg: "Dont run this on Ubuntu"
      when: ansible_facts['distribution'] == "Ubuntu"

Lets write a playbook which throws an error when run on ubuntu 22.04

  • Solution
- name: throws an error when run on Ubuntu 22.04
  hosts: all
  gather_facts: yes
  become: no
  tasks:
    - name: fail the playbook
      ansible.builtin.fail:
        msg: "Dont run this on Ubuntu"
      when: ansible_facts['distribution'] == "Ubuntu" and ansible_facts['distribution_version'] == "22.04"

How to use ansible_facts[]

- name: print facts
  hosts: all
  gather_facts: yes
  become: no
  tasks:
    - name: print facts
      ansible.builtin.debug:
        var: ansible_facts
  • The json
{
  "all_ipv4_addresses": [
    "172.16.0.4"
  ],
  "all_ipv6_addresses": [
    "fe80::7e1e:52ff:fe0f:5b50"
  ],
  "ansible_local": {

  },
  "apparmor": {
    "status": "enabled"
  },
  "architecture": "x86_64",
  "bios_date": "05/13/2024",
  "bios_vendor": "Microsoft Corporation",
  "bios_version": "Hyper-V UEFI Release v4.1",
  "board_asset_tag": "None",
  "board_name": "Virtual Machine",
  "board_serial": "NA",
  "board_vendor": "Microsoft Corporation",
  "board_version": "Hyper-V UEFI Release v4.1",
  "chassis_asset_tag": "7783-7084-3265-9085-8269-3286-77",
  "chassis_serial": "NA",
  "chassis_vendor": "Microsoft Corporation",
  "chassis_version": "Hyper-V UEFI Release v4.1",
  "cmdline": {
    "BOOT_IMAGE": "/vmlinuz-6.14.0-1017-azure",
    "console": "ttyS0",
    "earlyprintk": "ttyS0",
    "nvme_core.io_timeout": "240",
    "panic": "-1",
    "ro": true,
    "root": "PARTUUID=7a5a3aff-efaf-4ead-97e8-73ce273e5901"
  },
  "date_time": {
    "date": "2026-02-16",
    "day": "16",
    "epoch": "1771214607",
    "epoch_int": "1771214607",
    "hour": "04",
    "iso8601": "2026-02-16T04:03:27Z",
    "iso8601_basic": "20260216T040327589676",
    "iso8601_basic_short": "20260216T040327",
    "iso8601_micro": "2026-02-16T04:03:27.589676Z",
    "minute": "03",
    "month": "02",
    "second": "27",
    "time": "04:03:27",
    "tz": "UTC",
    "tz_dst": "UTC",
    "tz_offset": "+0000",
    "weekday": "Monday",
    "weekday_number": "1",
    "weeknumber": "07",
    "year": "2026"
  },
  "default_ipv4": {
    "address": "172.16.0.4",
    "alias": "eth0",
    "broadcast": "",
    "gateway": "172.16.0.1",
    "interface": "eth0",
    "macaddress": "7c:1e:52:0f:5b:50",
    "mtu": 1500,
    "netmask": "255.255.255.0",
    "network": "172.16.0.0",
    "prefix": "24",
    "type": "ether"
  },
  "default_ipv6": {

  },
  "device_links": {
    "ids": {
      "sda": [
        "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7",
        "scsi-36002248046141973adc280831834cde7",
        "wwn-0x6002248046141973adc280831834cde7"
      ],
      "sda1": [
        "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part1",
        "scsi-36002248046141973adc280831834cde7-part1",
        "wwn-0x6002248046141973adc280831834cde7-part1"
      ],
      "sda14": [
        "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part14",
        "scsi-36002248046141973adc280831834cde7-part14",
        "wwn-0x6002248046141973adc280831834cde7-part14"
      ],
      "sda15": [
        "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part15",
        "scsi-36002248046141973adc280831834cde7-part15",
        "wwn-0x6002248046141973adc280831834cde7-part15"
      ],
      "sda16": [
        "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part16",
        "scsi-36002248046141973adc280831834cde7-part16",
        "wwn-0x6002248046141973adc280831834cde7-part16"
      ],
      "sdb": [
        "scsi-14d53465420202020c8b2dfb52e44aa49a8fa864a9fdd44b2",
        "scsi-360022480c8b2dfb52e44864a9fdd44b2",
        "wwn-0x60022480c8b2dfb52e44864a9fdd44b2"
      ],
      "sdb1": [
        "scsi-14d53465420202020c8b2dfb52e44aa49a8fa864a9fdd44b2-part1",
        "scsi-360022480c8b2dfb52e44864a9fdd44b2-part1",
        "wwn-0x60022480c8b2dfb52e44864a9fdd44b2-part1"
      ],
      "sr0": [
        "scsi-14d534654202020207305e3437703544694957d7ced624a7d"
      ]
    },
    "labels": {
      "sda1": [
        "cloudimg-rootfs"
      ],
      "sda15": [
        "UEFI"
      ],
      "sda16": [
        "BOOT"
      ]
    },
    "masters": {

    },
    "uuids": {
      "sda1": [
        "e8f34ae5-b7c6-4ebc-a181-9f8d378f986f"
      ],
      "sda15": [
        "0A93-0BBD"
      ],
      "sda16": [
        "d5c7f0a8-4f57-4ac9-ac4f-0b5e6518e198"
      ],
      "sdb1": [
        "b05b8091-a479-41ee-855b-b8a298d29143"
      ]
    }
  },
  "devices": {
    "loop0": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "1",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "4096",
      "vendor": null,
      "virtual": 1
    },
    "loop1": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "0",
      "vendor": null,
      "virtual": 1
    },
    "loop2": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "0",
      "vendor": null,
      "virtual": 1
    },
    "loop3": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "0",
      "vendor": null,
      "virtual": 1
    },
    "loop4": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "0",
      "vendor": null,
      "virtual": 1
    },
    "loop5": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "0",
      "vendor": null,
      "virtual": 1
    },
    "loop6": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "0",
      "vendor": null,
      "virtual": 1
    },
    "loop7": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [

        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": null,
      "partitions": {

      },
      "removable": "0",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "none",
      "sectors": 0,
      "sectorsize": "512",
      "size": "0.00 Bytes",
      "support_discard": "0",
      "vendor": null,
      "virtual": 1
    },
    "sda": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [
          "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7",
          "scsi-36002248046141973adc280831834cde7",
          "wwn-0x6002248046141973adc280831834cde7"
        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": "Virtual Disk",
      "partitions": {
        "sda1": {
          "holders": [

          ],
          "links": {
            "ids": [
              "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part1",
              "scsi-36002248046141973adc280831834cde7-part1",
              "wwn-0x6002248046141973adc280831834cde7-part1"
            ],
            "labels": [
              "cloudimg-rootfs"
            ],
            "masters": [

            ],
            "uuids": [
              "e8f34ae5-b7c6-4ebc-a181-9f8d378f986f"
            ]
          },
          "sectors": 60817375,
          "sectorsize": 512,
          "size": "29.00 GB",
          "start": "2099200",
          "uuid": "e8f34ae5-b7c6-4ebc-a181-9f8d378f986f"
        },
        "sda14": {
          "holders": [

          ],
          "links": {
            "ids": [
              "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part14",
              "scsi-36002248046141973adc280831834cde7-part14",
              "wwn-0x6002248046141973adc280831834cde7-part14"
            ],
            "labels": [

            ],
            "masters": [

            ],
            "uuids": [

            ]
          },
          "sectors": 8192,
          "sectorsize": 512,
          "size": "4.00 MB",
          "start": "2048",
          "uuid": null
        },
        "sda15": {
          "holders": [

          ],
          "links": {
            "ids": [
              "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part15",
              "scsi-36002248046141973adc280831834cde7-part15",
              "wwn-0x6002248046141973adc280831834cde7-part15"
            ],
            "labels": [
              "UEFI"
            ],
            "masters": [

            ],
            "uuids": [
              "0A93-0BBD"
            ]
          },
          "sectors": 217088,
          "sectorsize": 512,
          "size": "106.00 MB",
          "start": "10240",
          "uuid": "0A93-0BBD"
        },
        "sda16": {
          "holders": [

          ],
          "links": {
            "ids": [
              "scsi-14d5346542020202046141973adc2d44a9f4a80831834cde7-part16",
              "scsi-36002248046141973adc280831834cde7-part16",
              "wwn-0x6002248046141973adc280831834cde7-part16"
            ],
            "labels": [
              "BOOT"
            ],
            "masters": [

            ],
            "uuids": [
              "d5c7f0a8-4f57-4ac9-ac4f-0b5e6518e198"
            ]
          },
          "sectors": 1869825,
          "sectorsize": 512,
          "size": "913.00 MB",
          "start": "227328",
          "uuid": "d5c7f0a8-4f57-4ac9-ac4f-0b5e6518e198"
        }
      },
      "removable": "0",
      "rotational": "1",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "mq-deadline",
      "sectors": 62916608,
      "sectorsize": "512",
      "size": "30.00 GB",
      "support_discard": "2097152",
      "vendor": "Msft",
      "virtual": 1,
      "wwn": "0x6002248046141973adc280831834cde7"
    },
    "sdb": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [
          "scsi-14d53465420202020c8b2dfb52e44aa49a8fa864a9fdd44b2",
          "scsi-360022480c8b2dfb52e44864a9fdd44b2",
          "wwn-0x60022480c8b2dfb52e44864a9fdd44b2"
        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": "Virtual Disk",
      "partitions": {
        "sdb1": {
          "holders": [

          ],
          "links": {
            "ids": [
              "scsi-14d53465420202020c8b2dfb52e44aa49a8fa864a9fdd44b2-part1",
              "scsi-360022480c8b2dfb52e44864a9fdd44b2-part1",
              "wwn-0x60022480c8b2dfb52e44864a9fdd44b2-part1"
            ],
            "labels": [

            ],
            "masters": [

            ],
            "uuids": [
              "b05b8091-a479-41ee-855b-b8a298d29143"
            ]
          },
          "sectors": 8384512,
          "sectorsize": 512,
          "size": "4.00 GB",
          "start": "2048",
          "uuid": "b05b8091-a479-41ee-855b-b8a298d29143"
        }
      },
      "removable": "0",
      "rotational": "1",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "mq-deadline",
      "sectors": 8388608,
      "sectorsize": "512",
      "size": "4.00 GB",
      "support_discard": "2097152",
      "vendor": "Msft",
      "virtual": 1,
      "wwn": "0x60022480c8b2dfb52e44864a9fdd44b2"
    },
    "sr0": {
      "holders": [

      ],
      "host": "",
      "links": {
        "ids": [
          "scsi-14d534654202020207305e3437703544694957d7ced624a7d"
        ],
        "labels": [

        ],
        "masters": [

        ],
        "uuids": [

        ]
      },
      "model": "Virtual DVD-ROM",
      "partitions": {

      },
      "removable": "1",
      "rotational": "0",
      "sas_address": null,
      "sas_device_handle": null,
      "scheduler_mode": "mq-deadline",
      "sectors": 314,
      "sectorsize": "2048",
      "size": "628.00 KB",
      "support_discard": "0",
      "vendor": "Msft",
      "virtual": 1
    }
  },
  "discovered_interpreter_python": "/usr/bin/python3.12",
  "distribution": "Ubuntu",
  "distribution_file_parsed": true,
  "distribution_file_path": "/etc/os-release",
  "distribution_file_variety": "Debian",
  "distribution_major_version": "24",
  "distribution_release": "noble",
  "distribution_version": "24.04",
  "dns": {
    "nameservers": [
      "127.0.0.53"
    ],
    "options": {
      "edns0": true,
      "trust-ad": true
    },
    "search": [
      "3lytnfcx4ple1jqmdgyzxx2icg.rx.internal.cloudapp.net"
    ]
  },
  "domain": "internal.cloudapp.net",
  "effective_group_id": 1000,
  "effective_user_id": 1000,
  "env": {
    "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
    "HOME": "/home/ansible",
    "LANG": "C.UTF-8",
    "LOGNAME": "ansible",
    "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
    "PWD": "/home/ansible",
    "SHELL": "/bin/bash",
    "SHLVL": "0",
    "SSH_CLIENT": "127.0.0.1 36600 22",
    "SSH_CONNECTION": "127.0.0.1 36600 127.0.0.1 22",
    "SSH_TTY": "/dev/pts/2",
    "TERM": "xterm-256color",
    "USER": "ansible",
    "XDG_RUNTIME_DIR": "/run/user/1000",
    "XDG_SESSION_CLASS": "user",
    "XDG_SESSION_ID": "709",
    "XDG_SESSION_TYPE": "tty",
    "_": "/bin/sh"
  },
  "eth0": {
    "active": true,
    "device": "eth0",
    "features": {
      "esp_hw_offload": "off [fixed]",
      "esp_tx_csum_hw_offload": "off [fixed]",
      "generic_receive_offload": "on",
      "generic_segmentation_offload": "on",
      "highdma": "on [fixed]",
      "hsr_dup_offload": "off [fixed]",
      "hsr_fwd_offload": "off [fixed]",
      "hsr_tag_ins_offload": "off [fixed]",
      "hsr_tag_rm_offload": "off [fixed]",
      "hw_tc_offload": "off [fixed]",
      "l2_fwd_offload": "off [fixed]",
      "large_receive_offload": "on",
      "loopback": "off [fixed]",
      "macsec_hw_offload": "off [fixed]",
      "ntuple_filters": "off [fixed]",
      "receive_hashing": "on",
      "rx_all": "off [fixed]",
      "rx_checksumming": "on",
      "rx_fcs": "off [fixed]",
      "rx_gro_hw": "off [fixed]",
      "rx_gro_list": "off",
      "rx_udp_gro_forwarding": "off",
      "rx_udp_tunnel_port_offload": "off [fixed]",
      "rx_vlan_filter": "off [fixed]",
      "rx_vlan_offload": "on [fixed]",
      "rx_vlan_stag_filter": "off [fixed]",
      "rx_vlan_stag_hw_parse": "off [fixed]",
      "scatter_gather": "on",
      "tcp_segmentation_offload": "on",
      "tls_hw_record": "off [fixed]",
      "tls_hw_rx_offload": "off [fixed]",
      "tls_hw_tx_offload": "off [fixed]",
      "tx_checksum_fcoe_crc": "off [fixed]",
      "tx_checksum_ip_generic": "off [fixed]",
      "tx_checksum_ipv4": "on",
      "tx_checksum_ipv6": "on",
      "tx_checksum_sctp": "off [fixed]",
      "tx_checksumming": "on",
      "tx_esp_segmentation": "off [fixed]",
      "tx_fcoe_segmentation": "off [fixed]",
      "tx_gre_csum_segmentation": "off [fixed]",
      "tx_gre_segmentation": "off [fixed]",
      "tx_gso_list": "off [fixed]",
      "tx_gso_partial": "off [fixed]",
      "tx_gso_robust": "off [fixed]",
      "tx_ipxip4_segmentation": "off [fixed]",
      "tx_ipxip6_segmentation": "off [fixed]",
      "tx_nocache_copy": "off",
      "tx_scatter_gather": "on",
      "tx_scatter_gather_fraglist": "off [fixed]",
      "tx_sctp_segmentation": "off [fixed]",
      "tx_tcp6_segmentation": "on",
      "tx_tcp_ecn_segmentation": "off [fixed]",
      "tx_tcp_mangleid_segmentation": "off",
      "tx_tcp_segmentation": "on",
      "tx_tunnel_remcsum_segmentation": "off [fixed]",
      "tx_udp_segmentation": "off [fixed]",
      "tx_udp_tnl_csum_segmentation": "off [fixed]",
      "tx_udp_tnl_segmentation": "off [fixed]",
      "tx_vlan_offload": "on [fixed]",
      "tx_vlan_stag_hw_insert": "off [fixed]",
      "vlan_challenged": "off [fixed]"
    },
    "hw_timestamp_filters": [

    ],
    "ipv4": {
      "address": "172.16.0.4",
      "broadcast": "",
      "netmask": "255.255.255.0",
      "network": "172.16.0.0",
      "prefix": "24"
    },
    "ipv6": [
      {
        "address": "fe80::7e1e:52ff:fe0f:5b50",
        "prefix": "64",
        "scope": "link"
      }
    ],
    "macaddress": "7c:1e:52:0f:5b:50",
    "module": "hv_netvsc",
    "mtu": 1500,
    "pciid": "7c1e520f-5b50-7c1e-520f-5b507c1e520f",
    "promisc": false,
    "speed": 50000,
    "timestamping": [

    ],
    "type": "ether"
  },
  "fibre_channel_wwn": [

  ],
  "fips": false,
  "flags": [
    "fpu",
    "vme",
    "de",
    "pse",
    "tsc",
    "msr",
    "pae",
    "mce",
    "cx8",
    "apic",
    "sep",
    "mtrr",
    "pge",
    "mca",
    "cmov",
    "pat",
    "pse36",
    "clflush",
    "mmx",
    "fxsr",
    "sse",
    "sse2",
    "ss",
    "syscall",
    "nx",
    "pdpe1gb",
    "rdtscp",
    "lm",
    "constant_tsc",
    "rep_good",
    "nopl",
    "xtopology",
    "tsc_reliable",
    "nonstop_tsc",
    "cpuid",
    "aperfmperf",
    "tsc_known_freq",
    "pni",
    "pclmulqdq",
    "ssse3",
    "fma",
    "cx16",
    "pcid",
    "sse4_1",
    "sse4_2",
    "x2apic",
    "movbe",
    "popcnt",
    "tsc_deadline_timer",
    "aes",
    "xsave",
    "avx",
    "f16c",
    "rdrand",
    "hypervisor",
    "lahf_lm",
    "abm",
    "3dnowprefetch",
    "fsgsbase",
    "tsc_adjust",
    "bmi1",
    "hle",
    "avx2",
    "smep",
    "bmi2",
    "erms",
    "invpcid",
    "rtm",
    "avx512f",
    "avx512dq",
    "rdseed",
    "adx",
    "smap",
    "clflushopt",
    "clwb",
    "avx512cd",
    "avx512bw",
    "avx512vl",
    "xsaveopt",
    "xsavec",
    "xgetbv1",
    "xsaves",
    "avx512_vnni",
    "arch_capabilities"
  ],
  "form_factor": "Desktop",
  "fqdn": "ansible.internal.cloudapp.net",
  "gather_subset": [
    "all"
  ],
  "hostname": "ansible",
  "hostnqn": "nqn.2014-08.org.nvmexpress:uuid:3aec3b80-962e-45a1-8bf1-de5a99022137",
  "interfaces": [
    "lo",
    "eth0"
  ],
  "is_chroot": false,
  "iscsi_iqn": "",
  "kernel": "6.14.0-1017-azure",
  "kernel_version": "#17~24.04.1-Ubuntu SMP Mon Dec  1 20:10:50 UTC 2025",
  "lo": {
    "active": true,
    "device": "lo",
    "features": {
      "esp_hw_offload": "off [fixed]",
      "esp_tx_csum_hw_offload": "off [fixed]",
      "generic_receive_offload": "on",
      "generic_segmentation_offload": "on",
      "highdma": "on [fixed]",
      "hsr_dup_offload": "off [fixed]",
      "hsr_fwd_offload": "off [fixed]",
      "hsr_tag_ins_offload": "off [fixed]",
      "hsr_tag_rm_offload": "off [fixed]",
      "hw_tc_offload": "off [fixed]",
      "l2_fwd_offload": "off [fixed]",
      "large_receive_offload": "off [fixed]",
      "loopback": "on [fixed]",
      "macsec_hw_offload": "off [fixed]",
      "ntuple_filters": "off [fixed]",
      "receive_hashing": "off [fixed]",
      "rx_all": "off [fixed]",
      "rx_checksumming": "on [fixed]",
      "rx_fcs": "off [fixed]",
      "rx_gro_hw": "off [fixed]",
      "rx_gro_list": "off",
      "rx_udp_gro_forwarding": "off",
      "rx_udp_tunnel_port_offload": "off [fixed]",
      "rx_vlan_filter": "off [fixed]",
      "rx_vlan_offload": "off [fixed]",
      "rx_vlan_stag_filter": "off [fixed]",
      "rx_vlan_stag_hw_parse": "off [fixed]",
      "scatter_gather": "on",
      "tcp_segmentation_offload": "on",
      "tls_hw_record": "off [fixed]",
      "tls_hw_rx_offload": "off [fixed]",
      "tls_hw_tx_offload": "off [fixed]",
      "tx_checksum_fcoe_crc": "off [fixed]",
      "tx_checksum_ip_generic": "on [fixed]",
      "tx_checksum_ipv4": "off [fixed]",
      "tx_checksum_ipv6": "off [fixed]",
      "tx_checksum_sctp": "on [fixed]",
      "tx_checksumming": "on",
      "tx_esp_segmentation": "off [fixed]",
      "tx_fcoe_segmentation": "off [fixed]",
      "tx_gre_csum_segmentation": "off [fixed]",
      "tx_gre_segmentation": "off [fixed]",
      "tx_gso_list": "on",
      "tx_gso_partial": "off [fixed]",
      "tx_gso_robust": "off [fixed]",
      "tx_ipxip4_segmentation": "off [fixed]",
      "tx_ipxip6_segmentation": "off [fixed]",
      "tx_nocache_copy": "off [fixed]",
      "tx_scatter_gather": "on [fixed]",
      "tx_scatter_gather_fraglist": "on [fixed]",
      "tx_sctp_segmentation": "on",
      "tx_tcp6_segmentation": "on",
      "tx_tcp_ecn_segmentation": "on",
      "tx_tcp_mangleid_segmentation": "on",
      "tx_tcp_segmentation": "on",
      "tx_tunnel_remcsum_segmentation": "off [fixed]",
      "tx_udp_segmentation": "on",
      "tx_udp_tnl_csum_segmentation": "off [fixed]",
      "tx_udp_tnl_segmentation": "off [fixed]",
      "tx_vlan_offload": "off [fixed]",
      "tx_vlan_stag_hw_insert": "off [fixed]",
      "vlan_challenged": "on [fixed]"
    },
    "hw_timestamp_filters": [

    ],
    "ipv4": {
      "address": "127.0.0.1",
      "broadcast": "",
      "netmask": "255.0.0.0",
      "network": "127.0.0.0",
      "prefix": "8"
    },
    "ipv6": [
      {
        "address": "::1",
        "prefix": "128",
        "scope": "host"
      }
    ],
    "mtu": 65536,
    "promisc": false,
    "timestamping": [

    ],
    "type": "loopback"
  },
  "loadavg": {
    "15m": 0.0068359375,
    "1m": 0.10791015625,
    "5m": 0.03857421875
  },
  "locally_reachable_ips": {
    "ipv4": [
      "127.0.0.0/8",
      "127.0.0.1",
      "172.16.0.4"
    ],
    "ipv6": [
      "::1",
      "fe80::7e1e:52ff:fe0f:5b50"
    ]
  },
  "lsb": {
    "codename": "noble",
    "description": "Ubuntu 24.04.3 LTS",
    "id": "Ubuntu",
    "major_release": "24",
    "release": "24.04"
  },
  "lvm": "N/A",
  "machine": "x86_64",
  "machine_id": "4e98118f63df46c3a5eed8d1d1f707f5",
  "memfree_mb": 99,
  "memory_mb": {
    "nocache": {
      "free": 452,
      "used": 396
    },
    "real": {
      "free": 99,
      "total": 848,
      "used": 749
    },
    "swap": {
      "cached": 0,
      "free": 0,
      "total": 0,
      "used": 0
    }
  },
  "memtotal_mb": 848,
  "module_setup": true,
  "mounts": [
    {
      "block_available": 6702893,
      "block_size": 4096,
      "block_total": 7344928,
      "block_used": 642035,
      "device": "/dev/root",
      "dump": 0,
      "fstype": "ext4",
      "inode_available": 3678106,
      "inode_total": 3801088,
      "inode_used": 122982,
      "mount": "/",
      "options": "rw,relatime,discard,errors=remount-ro,commit=30",
      "passno": 0,
      "size_available": 27455049728,
      "size_total": 30084825088,
      "uuid": "e8f34ae5-b7c6-4ebc-a181-9f8d378f986f"
    },
    {
      "block_available": 193682,
      "block_size": 4096,
      "block_total": 225380,
      "block_used": 31698,
      "device": "/dev/sda16",
      "dump": 0,
      "fstype": "ext4",
      "inode_available": 57896,
      "inode_total": 58496,
      "inode_used": 600,
      "mount": "/boot",
      "options": "rw,relatime,discard",
      "passno": 0,
      "size_available": 793321472,
      "size_total": 923156480,
      "uuid": "d5c7f0a8-4f57-4ac9-ac4f-0b5e6518e198"
    },
    {
      "block_available": 201164,
      "block_size": 512,
      "block_total": 213663,
      "block_used": 12499,
      "device": "/dev/sda15",
      "dump": 0,
      "fstype": "vfat",
      "inode_available": 0,
      "inode_total": 0,
      "inode_used": 0,
      "mount": "/boot/efi",
      "options": "rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro",
      "passno": 0,
      "size_available": 102995968,
      "size_total": 109395456,
      "uuid": "0A93-0BBD"
    },
    {
      "block_available": 954622,
      "block_size": 4096,
      "block_total": 1011128,
      "block_used": 56506,
      "device": "/dev/sdb1",
      "dump": 0,
      "fstype": "ext4",
      "inode_available": 262132,
      "inode_total": 262144,
      "inode_used": 12,
      "mount": "/mnt",
      "options": "rw,relatime",
      "passno": 0,
      "size_available": 3910131712,
      "size_total": 4141580288,
      "uuid": "b05b8091-a479-41ee-855b-b8a298d29143"
    }
  ],
  "nodename": "ansible",
  "os_family": "Debian",
  "pkg_mgr": "apt",
  "proc_cmdline": {
    "BOOT_IMAGE": "/vmlinuz-6.14.0-1017-azure",
    "console": [
      "tty1",
      "ttyS0"
    ],
    "earlyprintk": "ttyS0",
    "nvme_core.io_timeout": "240",
    "panic": "-1",
    "ro": true,
    "root": "PARTUUID=7a5a3aff-efaf-4ead-97e8-73ce273e5901"
  },
  "processor": [
    "0",
    "GenuineIntel",
    "Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz"
  ],
  "processor_cores": 1,
  "processor_count": 1,
  "processor_nproc": 1,
  "processor_threads_per_core": 1,
  "processor_vcpus": 1,
  "product_name": "Virtual Machine",
  "product_serial": "NA",
  "product_uuid": "1252b3a4-d905-49e0-86c9-f21a8591fee4",
  "product_version": "Hyper-V UEFI Release v4.1",
  "python": {
    "executable": "/usr/bin/python3.12",
    "has_sslcontext": true,
    "type": "cpython",
    "version": {
      "major": 3,
      "micro": 3,
      "minor": 12,
      "releaselevel": "final",
      "serial": 0
    },
    "version_info": [
      3,
      12,
      3,
      "final",
      0
    ]
  },
  "python_version": "3.12.3",
  "real_group_id": 1000,
  "real_user_id": 1000,
  "selinux": {
    "status": "disabled"
  },
  "selinux_python_present": true,
  "service_mgr": "systemd",
  "ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAffyinSyTseosNgQ8qwfFA+4NGFpGzOtKWe+VZs+BApfp1DcuTZZSb38AldC6jFEa8j7QTeg89vjqLspxFN2m8=",
  "ssh_host_key_ecdsa_public_keytype": "ecdsa-sha2-nistp256",
  "ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIHo0PCmGgvKXvfxKWCpUGAmM/wixSY+sLbxZW3kazeyS",
  "ssh_host_key_ed25519_public_keytype": "ssh-ed25519",
  "ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABgQCq3cu72P4sT41zfhdOujD5fS5eSBkGzxTb0hfYN8QQyM/7qHri27qSmRED1oFj1fAfWjzPs9SUXn2PSECtA8H5AkParw98Df7D2YCgtkPhJYwgB1UyO2GBVvanIsxD9ZDn0OBXRt7hOmGwXul/j4bkQt29YsWVsTqAHtTWd99Gn56274njYhBpXCmKgLraQVq3cVdN5c7MWCskqznPDXDLS+cSdM5heQGj1LUAEiIDbfwCoyA6QM23uLQpfsZNOM7KMyi37f0+d5Z+D3XER0qGADFftUUug+gOpcKrP41E8tdRCTH6fubNhoXIIsyDD5E2eA4SckQuKazV3YBMnGWeTrAOMjDeaGuNMY2JsP+RtvUdMBDxZqK95ygiBT80KNY642iPrlU1HNHOy5fWKsOmuDk13YowkvGL7QU1dKJM0yUbU2iK4UgFoGjujQzxEy7/z8exAumbhR6kNOQZGBWRl/oO3nHwJvchtblq1K79P9zMfajKJkbRT/lv728z4G8=",
  "ssh_host_key_rsa_public_keytype": "ssh-rsa",
  "swapfree_mb": 0,
  "swaptotal_mb": 0,
  "system": "Linux",
  "system_capabilities": [
    ""
  ],
  "system_capabilities_enforced": "True",
  "system_vendor": "Microsoft Corporation",
  "systemd": {
    "features": "+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified",
    "version": 255
  },
  "uptime_seconds": 344445,
  "user_dir": "/home/ansible",
  "user_gecos": "Ubuntu",
  "user_gid": 1000,
  "user_id": "ansible",
  "user_shell": "/bin/bash",
  "user_uid": 1000,
  "userspace_architecture": "x86_64",
  "userspace_bits": "64",
  "virtualization_role": "guest",
  "virtualization_tech_guest": [
    "VirtualPC"
  ],
  "virtualization_tech_host": [

  ],
  "virtualization_type": "VirtualPC"
}

Lets try installing latest version of tomcat 11 on Ubuntu

  • Lets do this manually and figure out all steps.
  • To install tomcat 11 we need

    • java 21 or java 17
  • prompt Give me all the steps to how to install tomcat 11 on ubuntu 24.04 right from pre-reqs
  • Refer Here for actual steps
  • Goal: A playbook for installing tomcat 11 on Ubuntu 24 as well as Redhat 9
  • Exercise: Install tomcat 10 on ubuntu 24 and redhat 9/10

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube