Skip to content

pulp.squeezer ignores environment variables #222

@h3krn

Description

@h3krn

The pulp.squeezer documents refer to the use of environment variables for authentication and setting the pulp server URL. I've setup a multi-container pulp instance running on a VM with podman. While trying to configure with ansible / pulp.squeezer I've run into the issue that pulp.squeezer seems to ignore the environment variables as documented here: https://galaxy.ansible.com/ui/repo/published/pulp/squeezer/content/module/rpm_remote/

Am I doing something wrong? Is the documentation wrong? Or did I hit a bug?

Specifiying host, user & password in the yaml file works

$ cat pulp_rpm_remote.yml 
---
- name: Create rpm remote
  hosts: all
  become: true
  gather_facts: false
  tasks:
    - name: Create a rpm remote
      pulp.squeezer.rpm_remote:
        pulp_url: http://localhost:8080
        username: admin
        password: password
        name: almalinux10-os
        url: https://repo.almalinux.org/almalinux/10/BaseOS/x86_64/os/
        state: present
$ export | grep SQUEEZER
$ poetry run ansible-playbook -i hosts.yml pulp_rpm_remote.yml 

PLAY [Create rpm remote] *********************************************************

TASK [Create a rpm remote] *******************************************************
changed: [packagerepo-am3-01]

PLAY RECAP ***********************************************************************
packagerepo-am3-01         : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Using environment variables does not:

$ cat pulp_rpm_remote_env.yml 
---
- name: Create rpm remote
  hosts: all
  become: true
  gather_facts: false
  tasks:
    - name: Create a rpm remote
      pulp.squeezer.rpm_remote:
        name: almalinux10-os
        url: https://repo.almalinux.org/almalinux/10/BaseOS/x86_64/os/
        state: present
$ export SQUEEZER_PULP_URL=http://localhost:8080
$ export SQUEEZER_PASSWORD=password
$ export SQUEEZER_USERNAME=admin
$ poetry run ansible-playbook -i hosts.yml pulp_rpm_remote_env.yml 

PLAY [Create rpm remote] *********************************************************

TASK [Create a rpm remote] *******************************************************
fatal: [packagerepo-am3-01]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "missing required arguments: pulp_url"}

PLAY RECAP ***********************************************************************
packagerepo-am3-01         : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Ansible controller is Linux Mint 22.1 (ubuntu24.04) with pulp.squeezer:0.2.2

$ poetry run ansible --version
ansible [core 2.16.3]
  config file = None
  configured module search path = ['/home/harm/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/harm/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Ansible target is Ubuntu 24.04

root@packagerepo-am3-01:~# pip list | grep pulp
pulp-cli             0.36.0
pulp-glue            0.36.0

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