Create Repository via Ansible

Problem to use amsible_repository module
Expected outcome:

Pulpcore version:
[root@imip-p-euw-pulp-01 ansible]# pulp --version
pulp3 command line interface, version 0.12.0
[root@imip-p-euw-pulp-01 ansible]# pulpcore-manager --version
[root@imip-p-euw-pulp-01 ansible]#
Pulp plugins installed and their versions:

Operating system - distribution and version:
Pulp 3 server : RHEL 8.2

Other relevant data:
Hello Sirs, could you please help me with that issue:
I’m following the statements according to pulp site: Manage Pulp 3 with Ansible | software repository management that looks like very simple but as you can see below, once I’m trying to run the playbook, I’m getting this error below
Could you please help me?
This is the playbook

  • name: “Playing with Ansible | Pulp Repo task”
    hosts: localhost
    connection: local

    • name: Make repository present
      name: demo_repository
      description: A new repository for Pulp test
      state: present

    • name: Make remote present
      name: demo_remote
      url: “$releasever/os/$basearch/
      state: present

    • name: Sync remote into Repo
      remote: demo_remote
      repository: demo_repository

    • name: Distribute latest version of repo
      name: demo_distribution
      base_path: squeezer/demo
      repository: demo_repository
      state: present

Follow the error messages:
[root@imip-p-euw-pulp-01 ansible]# ansible-playbook repo_settings.yml --check

PLAY [Playing with Ansible | Pulp Repo task] ***************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************
ok: [localhost]

TASK [Make repository present] *****************************************************************************************************************************
fatal: [localhost]: FAILED! => {“changed": false, “msg”: "missing required arguments: pulp_url, username, password”}

PLAY RECAP *************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

[root@imip-p-euw-pulp-01 ansible]#
[root@imip-p-euw-pulp-01 ansible]#

You need to provide the credentials to access your server (pulp_url, username and password) to the modules. Also it looks like you are interested in synching a RPM repository and not ansible one. Try using the rpm_* modules.

1 Like