+
Skip to content

The profile report is missing tasks when callbacks_enabled = profile_tasks in ansible.cfg #645

Open
@tedheadster

Description

@tedheadster
SUMMARY

When running a playbook and seeing the final profile report, it was missing many tasks that should have been listed with the "callbacks_enabled = profile_tasks" option.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible.posix

ANSIBLE VERSION
ansible [core 2.14.18]
  config file = /root/ansible-install-gentoo/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection    Version
------------- -------
ansible.posix 1.5.4  
CONFIGURATION
CALLBACKS_ENABLED(/root/ansible-install-gentoo/ansible.cfg) = ['profile_tasks']
CONFIG_FILE() = /root/ansible-install-gentoo/ansible.cfg
DEFAULT_HOST_LIST(/root/ansible-install-gentoo/ansible.cfg) = ['/root/ansible-install-gentoo/inventory']
OS / ENVIRONMENT

Linux raspberrypi 6.6.51+rpt-rpi-2712 ansible/ansible#1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux

STEPS TO REPRODUCE

Unsure how to reproduce this yet.

This code snippet got different results in a larger playbook, but running it in a small playbook does not seem to reproduce it. The "Get disk size in GiB" was in the profile report, but the "Get RAM size in MiB" was NOT.

Here MAIN_DISK is "/dev/sda".

    - name: "Get RAM size in MiB"
      ansible.builtin.set_fact:
        ram_mb: "{{ ansible_facts['memtotal_mb'] }}"

    - name: "Get disk size in GiB"
      ansible.builtin.set_fact:
        disk_size_gb: "{{ (ansible_facts['devices'][ MAIN_DISK | basename ]['sectors'] | int * 512 / (1024*1024*1024)) | int }}"
EXPECTED RESULTS

I expected all the tasks to appear in the profile report.

ACTUAL RESULTS

Here is a "diff -uNr" of what should have been in the profile report versus what did appear.

-Calculate swap size
-Create EFI partition
-Create GPT partition table
 Create Root partition
-Create swap partition
 Detect all mounted partitions on /dev/sda
 Disable swap on /dev/sda2
 Download latest stage3 file list
 Download the latest stage3 tarball
 Enable swap on /dev/sda2
-Ensure /mnt/gentoo exists
-Ensure /mnt/gentoo/boot exists
-Ensure /mnt/gentoo/boot/efi exists
-Ensure /mnt/gentoo/dev exists
-Ensure /mnt/gentoo/proc exists
-Ensure /mnt/gentoo/run exists
-Ensure /mnt/gentoo/sys exists
 Extract stage3 tarball
 Extract tarfile stage3_filename
-Format EFI partition (vfat)
-Format root partition (ext4)
-Format swap partition (swap)
 Gather facts in hosting system
-Get RAM size in MiB
 Get disk size in GiB
-Mount /mnt/gentoo
-Mount /mnt/gentoo/boot
-Mount /mnt/gentoo/dev rbind
-Mount /mnt/gentoo/dev rslave
 Mount /mnt/gentoo/proc
-Mount /mnt/gentoo/run
-Mount /mnt/gentoo/sys rbind
-Mount /mnt/gentoo/sys rslave
 Print important configuration variables
-Print memory and disk size
 Print tarfile stage3_filename
-Set EFI partition boot flag
 Try to download file:///root/.ssh/authorized_keys
 Try to download http://mirrors.rit.edu/gentoo/releases/arm64/autobuilds/current-stage3-arm64-systemd
 Unmount /mnt/gentoo/dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载