|
65 | 65 | - redhat_cdn |
66 | 66 | - network_sync |
67 | 67 | - export_sync |
| 68 | + - custom_cdn |
68 | 69 | upstream_url: |
69 | 70 | description: |
70 | 71 | - URL of the upstream resource |
|
106 | 107 | - Required when I(upstream_type) is C(network_sync) |
107 | 108 | required: false |
108 | 109 | type: str |
| 110 | + upstream_custom_cdn_auth_enabled: |
| 111 | + description: |
| 112 | + - If product certificates should be used to authenticate to a custom CDN. |
| 113 | + type: bool |
| 114 | + required: false |
109 | 115 | extends_documentation_fragment: |
110 | 116 | - theforeman.foreman.foreman |
111 | 117 | - theforeman.foreman.foreman.entity_state |
@@ -182,14 +188,15 @@ def main(): |
182 | 188 | label=dict(), |
183 | 189 | ignore_types=dict(type='list', elements='str', required=False, aliases=['select_all_types']), |
184 | 190 | select_all_types=dict(type='list', invisible=True, flat_name='ignore_types'), |
185 | | - upstream_type=dict(required=False, choices=['redhat_cdn', 'export_sync', 'network_sync']), |
| 191 | + upstream_type=dict(required=False, choices=['redhat_cdn', 'export_sync', 'network_sync', 'custom_cdn']), |
186 | 192 | upstream_url=dict(required=False), |
187 | 193 | upstream_username=dict(required=False), |
188 | 194 | upstream_password=dict(required=False, no_log=True), |
189 | 195 | upstream_ca_cert=dict(required=False, type='entity', resource_type='content_credentials', scope=['organization']), |
190 | 196 | upstream_organization=dict(required=False), |
191 | 197 | upstream_lifecycle_environment=dict(required=False), |
192 | 198 | upstream_content_view=dict(required=False), |
| 199 | + upstream_custom_cdn_auth_enabled=dict(required=False, type='bool'), |
193 | 200 | ), |
194 | 201 | ) |
195 | 202 |
|
@@ -229,6 +236,18 @@ def main(): |
229 | 236 | 'upstream_content_view_label': module.foreman_params['upstream_content_view'], |
230 | 237 | } |
231 | 238 | extra_payload.update(cdn_config) |
| 239 | + if module.foreman_params['upstream_type'] == 'custom_cdn': |
| 240 | + cdn_config = { |
| 241 | + 'url': module.foreman_params['upstream_url'], |
| 242 | + 'ssl_ca_credential_id': module.foreman_params['upstream_ca_cert'], |
| 243 | + 'username': module.foreman_params['upstream_username'], |
| 244 | + 'password': module.foreman_params['upstream_password'], |
| 245 | + 'upstream_organization_label': module.foreman_params['upstream_organization'], |
| 246 | + 'upstream_lifecycle_environment_label': module.foreman_params['upstream_lifecycle_environment'], |
| 247 | + 'upstream_content_view_label': module.foreman_params['upstream_content_view'], |
| 248 | + 'custom_cdn_auth_enabled': module.foreman_params['upstream_custom_cdn_auth_enabled'], |
| 249 | + } |
| 250 | + extra_payload.update(cdn_config) |
232 | 251 |
|
233 | 252 | current_cdn_config = {k: v for k, v in organization['cdn_configuration'].items() if v is not None} |
234 | 253 | del current_cdn_config['password_exists'] |
|
0 commit comments