From 8435e9332af8136ad582c147e3ba5c3913a9f3b3 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Tue, 7 Dec 2021 12:13:12 +0100 Subject: [PATCH] Add support for non-remote repositories --- roles/pulp_repository/tasks/container.yml | 5 ++++- roles/pulp_repository/tasks/deb.yml | 5 ++++- roles/pulp_repository/tasks/python.yml | 5 ++++- roles/pulp_repository/tasks/rpm.yml | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/roles/pulp_repository/tasks/container.yml b/roles/pulp_repository/tasks/container.yml index 037394e..b534564 100644 --- a/roles/pulp_repository/tasks/container.yml +++ b/roles/pulp_repository/tasks/container.yml @@ -35,6 +35,7 @@ url: "{{ item.url | default(omit) }}" state: "{{ item.state }}" with_items: "{{ pulp_repository_container_repos }}" + when: item.url is defined loop_control: label: "{{ item.name }}" @@ -47,6 +48,8 @@ repository: "{{ item.name }}" remote: "{{ item.name }}-remote" with_items: "{{ pulp_repository_container_repos }}" - when: item.state == "present" + when: + - item.url is defined + - item.state == "present" loop_control: label: "{{ item.name }}" diff --git a/roles/pulp_repository/tasks/deb.yml b/roles/pulp_repository/tasks/deb.yml index c8e0b15..5acc48f 100644 --- a/roles/pulp_repository/tasks/deb.yml +++ b/roles/pulp_repository/tasks/deb.yml @@ -35,6 +35,7 @@ url: "{{ item.url | default(omit) }}" state: "{{ item.state }}" with_items: "{{ pulp_repository_deb_repos }}" + when: item.url is defined loop_control: label: "{{ item.name }}" @@ -48,6 +49,8 @@ remote: "{{ item.name }}-remote" mirror: "{{ item.mirror | default(omit) }}" with_items: "{{ pulp_repository_deb_repos }}" - when: item.state == "present" + when: + - item.url is defined + - item.state == "present" loop_control: label: "{{ item.name }}" diff --git a/roles/pulp_repository/tasks/python.yml b/roles/pulp_repository/tasks/python.yml index 653d8ae..04fe2b1 100644 --- a/roles/pulp_repository/tasks/python.yml +++ b/roles/pulp_repository/tasks/python.yml @@ -35,6 +35,7 @@ url: "{{ item.url | default(omit) }}" state: "{{ item.state }}" with_items: "{{ pulp_repository_python_repos }}" + when: item.url is defined loop_control: label: "{{ item.name }}" @@ -47,6 +48,8 @@ repository: "{{ item.name }}" remote: "{{ item.name }}-remote" with_items: "{{ pulp_repository_python_repos }}" - when: item.state == "present" + when: + - item.url is defined + - item.state == "present" loop_control: label: "{{ item.name }}" diff --git a/roles/pulp_repository/tasks/rpm.yml b/roles/pulp_repository/tasks/rpm.yml index e7421ee..ec9898d 100644 --- a/roles/pulp_repository/tasks/rpm.yml +++ b/roles/pulp_repository/tasks/rpm.yml @@ -32,6 +32,7 @@ url: "{{ item.url | default(omit) }}" state: "{{ item.state }}" with_items: "{{ pulp_repository_rpm_repos }}" + when: item.url is defined loop_control: label: "{{ item.name }}" @@ -45,6 +46,8 @@ remote: "{{ item.name }}-remote" sync_policy: "{{ item.sync_policy | default(omit) }}" with_items: "{{ pulp_repository_rpm_repos }}" - when: item.state == "present" + when: + - item.url is defined + - item.state == "present" loop_control: label: "{{ item.name }}"