Skip to content

ansible_runner cmdline cache(env/cmdline) contamination #1440

@brinnatt

Description

@brinnatt

Ansible Runner version

ansible-runner 2.4.1

Python version

Python 3.12.10

Operating System and Environment

NAME="Rocky Linux"
VERSION="8.10 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.10 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.10"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.10"

Container Runtime

none

Summary

one ansible_runner process cmdline cache will pollute another ansible_runner proccess which will use cmdline cache first.

Steps to reproduce

  1. run one ansible_runner process with cmdline, for example:
    result = ansible_runner.run(
    private_data_dir=str(self.clusters_dir / name),
    playbook=str(self.playbooks_dir / playbook),
    inventory=str(self.clusters_dir / name / "hosts"),
    extravars=self._yaml_to_dict(self.clusters_dir / name / 'config.yml'),
    roles_path=str(self.roles_dir),
    cmdline='-t restart'
    )
  2. This will generate env/cmdline file in private_data_dir
  3. Then you run another ansible_runner process
    result = ansible_runner.run(
    private_data_dir=str(self.clusters_dir / name),
    playbook=str(self.playbooks_dir / playbook),
    inventory=str(self.clusters_dir / name / "hosts"),
    extravars=self._yaml_to_dict(self.clusters_dir / name / 'config.yml'),
    roles_path=str(self.roles_dir),
    )
  4. It does not work, because step 3 will also use env/cmdline cache, which cause step 3 lose efficacy.

Expected Results

step 3 can run all tasks in the playbook.

(please cancle env/cmdline cache design, acturally, the side effect far outweighs the benefits.)

Actual Results

step 3 doesn't work, it still run step 1 because of env/cmdline cache.

(please cancle env/cmdline cache design, acturally, the side effect far outweighs the benefits.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs_triageNew item that needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions