| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
from __future__ import absolute_import, division, print_function |
| 19 |
__metaclass__ = type |
| 20 |
|
| 21 |
|
| 22 |
DOCUMENTATION = ''' |
| 23 |
--- |
| 24 |
module: content_import_info |
| 25 |
version_added: 4.1.0 |
| 26 |
short_description: List content imports |
| 27 |
description: |
| 28 |
- List information about content imports. |
| 29 |
author: |
| 30 |
- "Partha Aji (@parthaa)" |
| 31 |
options: |
| 32 |
id: |
| 33 |
description: |
| 34 |
- Import history identifier. |
| 35 |
required: false |
| 36 |
type: int |
| 37 |
content_view_version: |
| 38 |
description: |
| 39 |
- Content view version. |
| 40 |
required: false |
| 41 |
type: str |
| 42 |
content_view: |
| 43 |
description: |
| 44 |
- Content view name. |
| 45 |
required: false |
| 46 |
type: str |
| 47 |
type: |
| 48 |
description: |
| 49 |
- Specify complete or incremental imports. |
| 50 |
required: false |
| 51 |
type: str |
| 52 |
choices: |
| 53 |
- complete |
| 54 |
- incremental |
| 55 |
extends_documentation_fragment: |
| 56 |
- theforeman.foreman.foreman |
| 57 |
- theforeman.foreman.foreman.katelloinfomodule |
| 58 |
- theforeman.foreman.foreman.infomodulewithoutname |
| 59 |
''' |
| 60 |
|
| 61 |
EXAMPLES = ''' |
| 62 |
- name: "List all imports in the organization" |
| 63 |
theforeman.foreman.content_import_info: |
| 64 |
organization: "Default Organization" |
| 65 |
type: complete |
| 66 |
username: "admin" |
| 67 |
password: "changeme" |
| 68 |
server_url: "https://foreman.example.com" |
| 69 |
- name: "Get a specific import history entry" |
| 70 |
theforeman.foreman.content_import_info: |
| 71 |
id: 29 |
| 72 |
username: "admin" |
| 73 |
password: "changeme" |
| 74 |
server_url: "https://foreman.example.com" |
| 75 |
organization: "Default Organization" |
| 76 |
- name: "List all imports of a specific content view version" |
| 77 |
theforeman.foreman.content_import_info: |
| 78 |
content_view: RHEL8 |
| 79 |
content_view_version: '1.0' |
| 80 |
username: "admin" |
| 81 |
password: "changeme" |
| 82 |
server_url: "https://foreman.example.com" |
| 83 |
organization: "Default Organization" |
| 84 |
- name: "List incremental imports of a specific content view" |
| 85 |
theforeman.foreman.content_import_info: |
| 86 |
content_view: RHEL8 |
| 87 |
type: incremental |
| 88 |
username: "admin" |
| 89 |
password: "changeme" |
| 90 |
server_url: "https://foreman.example.com" |
| 91 |
organization: "Default Organization" |
| 92 |
''' |
| 93 |
|
| 94 |
from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import KatelloInfoAnsibleModule |
| 95 |
|
| 96 |
|
| 97 |
class KatelloContentImportInfo(KatelloInfoAnsibleModule): |
| 98 |
pass |
| 99 |
|
| 100 |
|
| 101 |
def main(): |
| 102 |
module = KatelloContentImportInfo( |
| 103 |
foreman_spec=dict( |
| 104 |
id=dict(required=False, type='int'), |
| 105 |
content_view_version=dict(type='entity', scope=['content_view'], required=False), |
| 106 |
content_view=dict(type='entity', scope=['organization'], required=False), |
| 107 |
type=dict(required=False, type='str', choices=['complete', 'incremental']), |
| 108 |
name=dict(invisible=True), |
| 109 |
), |
| 110 |
) |
| 111 |
|
| 112 |
with module.api_connection(): |
| 113 |
module.run() |
| 114 |
|
| 115 |
|
| 116 |
if __name__ == '__main__': |
| 117 |
main() |