Setting distribution while creating a deb package

Hello guys :lemon:,
I’m using pulp_squeezer module to sync deb repositories through Ansible, but
while I’m synchronizing the repository to a specific distributions (stable), I expect that the distribution should stay the same as the remote, but it’s set to default instead.

Expected path: repository_name/ubuntu/dists/stable/
Current outcome path: repository_name/ubuntu/dists/default/

It this behavior intentional?
It there a way to customize it?

Related code
- name: "Create {{ repository_type }} remote objects"
  pulp.squeezer.deb_remote:
    name: "remote-{{ repository_type }}-{{ repo.name }}"
    url: "{{ repo.url }}"
    state: present
    policy: "{{remote_sync_policy}}"
    distributions: "stable"

- name: "Create {{ repository_type }} repository"
  pulp.squeezer.deb_repository:
    name: "{{ repository_type }}-{{ repo.name }}"
    state: present

- name: "Sync {{ repository_type }} repository from remote"
  pulp.squeezer.deb_sync:
    remote: "remote-{{ repository_type }}-{{ repo.name }}"
    repository: "{{ repository_type }}-{{ repo.name }}"
    mirror: true

- name: "Create a {{ repository_type }} publication"
  pulp.squeezer.deb_publication:
    repository: "{{ repository_type }}-{{ repo.name }}"
    state: present

- name: "Create a {{ repository_type }} distribution"
  pulp.squeezer.deb_distribution:
    name: "{{ repository_type }}-{{ pub_result.repo.name }}"
    base_path: "{{ pub_result.repo.name }}/{{ repository_type }}"
    state: present
    publication: "{{ pub_result.publication.pulp_href }}"

- name: "Remove {{ repository_type }} feed"
  pulp.squeezer.deb_remote:
      name: "remote-{{ repository_type }}-{{ repo.name }}"
      state: absent
1 Like

I think, what you want is to use mode: structured with the deb_publication module.

Also note there was a big pulp_deb update this week and squeezer, sadly, is a bit behind. I hope it still works together.

2 Likes

Love to hear there are actual squeezer users out there!

1 Like

I can also add some more extra context here:

@x9c4 is correct that this behaviour depends on whether the Pulp publication in question was created using “simple” and/or “structured” mode. Starting with pulp_deb 3.0.0 the server default is to use structured and not simple. This would result in your expected path.

You can read up on the behaviour in the last < 3.0.0 version of the documentation: Feature Overview — Pulp deb Support 2.21.2 documentation
By comparison the current version of the documentation which expects everyone to use “structured” by default has this to say: Feature Overview — Pulp deb Support 3.0.0 documentation

Even if you do upgrade to 3.0.0, I do not know if squeezer will rely on the servers default value of “structured” for publications, or whether it explicitly sets a default value of its own.

3 Likes