[Pulp-list] Create and remove repo with ansible

Brian Bouterse bbouters at redhat.com
Tue Apr 9 15:12:06 UTC 2019


We don't have one for Pulp3 yet, but we do want to make one. I created a
stub issue here to start tracking that effort.

https://pulp.plan.io/issues/4658

On Tue, Apr 9, 2019 at 10:58 AM Juan Cabrera <juan.cabrera at unamur.be> wrote:

> Thanks.
>
> I suppose this does not work with pup 3.x , isn't it ?
> On 9/04/19 16:00, Kodiak Firesmith wrote:
>
> For Pulp 2.x, I use this plus some extra commands:
> https://docs.ansible.com/ansible/latest/modules/pulp_repo_module.html
>
> On Tue, Apr 9, 2019 at 9:48 AM Juan Cabrera <juan.cabrera at unamur.be>
> wrote:
>
>> Hi,
>>
>> Is there an ansible module to add or remove a rpm repository ?
>>
>> I send in attachment the scripts I use for the moment to create and
>> remove the rpm repositories.
>>
>> I use this:
>>
>> vars:
>>
>>    - pulp_repos:
>>       - repo: epel_ptci
>>         remote: epel
>>         remote_url: https://epel.mirror.it2go.eu/7/x86_64/
>>         state: present
>>
>> TODO: to become idempotent, check if repo already exists
>>
>> - name: config | Add repositories.
>>   command: ~/create_repo --repo "{{ item.repo }}" --remote "{{
>> item.remote }}" --href "{{ item.remote_url }}"
>>   loop: "{{ pulp_repos }}"
>>   when: item.state is not defined or item.state == 'present'
>>   become: yes
>>   become_user: "{{ pulp_repo_user }}"
>>
>>
>> - name: config | Remove repositories
>>   command: ~/remove_repo --repo "{{ item.repo }}" --remote "{{
>> item.remote }}"
>>   loop: "{{ pulp_repos }}"
>>   when: item.state is defined and item.state == 'absent'
>>   become: yes
>>   become_user: "{{ pulp_repo_user }}"
>>
>> What is the best way to check if a repo already exist?
>>
>> Juan
>> --
>>
>> Juan CABRERA
>> Correspondant informatique
>> Département de Mathématiques
>>
>> T. 081724919
>> juan.cabrera at unamur.be
>> http://staff.unamur.be/jbcabrer
>>
>> Université de Namur ASBL
>> Rue de Bruxelles 61 - 5000 Namur
>> Belgique
>>
>> Let’s respect the environment together.
>> Only print this message if necessary!
>> _______________________________________________
>> Pulp-list mailing list
>> Pulp-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/pulp-list
>
> --
>
> Juan CABRERA
> Correspondant informatique
> Département de Mathématiques
>
> T. 081724919
> juan.cabrera at unamur.be
> http://staff.unamur.be/jbcabrer
>
> Université de Namur ASBL
> Rue de Bruxelles 61 - 5000 Namur
> Belgique
>
> Let’s respect the environment together.
> Only print this message if necessary!
> _______________________________________________
> Pulp-list mailing list
> Pulp-list at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20190409/a1c08299/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lhmcljcamdohejfn.png
Type: image/png
Size: 9356 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20190409/a1c08299/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nggfaociieifbbfe.png
Type: image/png
Size: 9356 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20190409/a1c08299/attachment-0001.png>


More information about the Pulp-list mailing list