# Hammer repository upload-content automation with ansible

**URL:** <https://forum.ansible.com/t/hammer-repository-upload-content-automation-with-ansible/3994>\
**Category:** Get Help\
**Tags:** howto\
**Created:** [February 22, 2024, 2:37pm UTC](https://forum.ansible.com/t/hammer-repository-upload-content-automation-with-ansible/3994 "2024-02-22T14:37:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@abhishek](https://forum.ansible.com/u/abhishek)\
**Post date:** [February 22, 2024, 2:37pm UTC](https://forum.ansible.com/t/hammer-repository-upload-content-automation-with-ansible/3994/1 "2024-02-22T14:37:40Z")

</div>

hammer repository upload-content --organization ORGANIZATION\_NAME --product “Product\_Name” --name “Repo\_name” --path “path of the file”

I want assistance to automate this manual process with ansible playbook which prompt for

[Foreman] Username: “username”  
[Foreman] Password for username: passwd

how to make it successfull upload and also sometimes it will give bad gateway error

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [February 23, 2024, 6:06pm UTC](https://forum.ansible.com/t/hammer-repository-upload-content-automation-with-ansible/3994/2 "2024-02-23T18:06:17Z")

</div>

Use [theforeman.foreman.content\_upload](https://docs.ansible.com/ansible/latest/collections/theforeman/foreman/content_upload_module.html#ansible-collections-theforeman-foreman-content-upload-module) module to upload your packages to a repository. The src/file is uploaded from the remote/target machine, not implicitly from your control node. It can be run on localhost and uploaded from your control node if that is preferred.

You can also use the certified [redhat.satellite.content\_upload](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/satellite/content/module/content_upload/) module if you’re using Red Hat Satellite.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 24, 2024, 6:06pm UTC](https://forum.ansible.com/t/hammer-repository-upload-content-automation-with-ansible/3994/3 "2024-03-24T18:06:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
