theforeman / foreman-ansible-modules

Ansible modules for interacting with the Foreman API and various plugin APIs such as Katello
GNU General Public License v3.0
149 stars 166 forks source link

content import modules (info, library, repository, version) #1720

Closed parthaa closed 7 months ago

parthaa commented 8 months ago

Added bindings to content import versions, repositories and library via foreman ansible modules.

--- 
- name: import to foreman
  hosts: localhost
  gather_facts: false
  tasks:
  - name: "Import repository"
    theforeman.foreman.content_import_repository:
        path: "/var/lib/pulp/exports/export-10380/Export-katello-1/1.0/2024-03-19T15-26-35-00-00"
        metadata: "{{ lookup('file', '/tmp/metadata.json') | from_json }}"
        username: "admin"
        password: "changeme"
        server_url: "http://darwin.lagrange.example.com"
        organization: "foo org"

you can also optionally use metadata_file instead of metadata

evgeni commented 8 months ago

Not a full review, as I know you're still working on this, but looks pretty nice already!

evgeni commented 7 months ago

You dropped the wrong register, that one is actually required

evgeni commented 7 months ago

thanks @parthaa!