|
| 1 | +#!/usr/bin/python |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +# (c) Evgeni Golov |
| 4 | +# |
| 5 | +# This program is free software: you can redistribute it and/or modify |
| 6 | +# it under the terms of the GNU General Public License as published by |
| 7 | +# the Free Software Foundation, either version 3 of the License, or |
| 8 | +# (at your option) any later version. |
| 9 | +# |
| 10 | +# This program is distributed in the hope that it will be useful, |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +# GNU General Public License for more details. |
| 14 | +# |
| 15 | +# You should have received a copy of the GNU General Public License |
| 16 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +from __future__ import absolute_import, division, print_function |
| 19 | +__metaclass__ = type |
| 20 | + |
| 21 | + |
| 22 | +DOCUMENTATION = ''' |
| 23 | +--- |
| 24 | +module: content_view_history_info |
| 25 | +version_added: 5.7.0 |
| 26 | +short_description: Fetch history of a Content View |
| 27 | +description: |
| 28 | + - Fetch history of a Content View |
| 29 | +author: |
| 30 | + - "Evgeni Golov (@evgeni)" |
| 31 | +options: |
| 32 | + content_view: |
| 33 | + description: |
| 34 | + - Content view to get the history for |
| 35 | + required: true |
| 36 | + type: str |
| 37 | +
|
| 38 | +extends_documentation_fragment: |
| 39 | + - redhat.satellite.foreman |
| 40 | + - redhat.satellite.foreman.katelloinfomodule |
| 41 | + - redhat.satellite.foreman.infomodulewithoutname |
| 42 | +''' |
| 43 | + |
| 44 | +EXAMPLES = ''' |
| 45 | +- name: "Show history of CentOS Stream CV" |
| 46 | + redhat.satellite.content_view_history_info: |
| 47 | + username: "admin" |
| 48 | + password: "changeme" |
| 49 | + server_url: "https://satellite.example.com" |
| 50 | + organization: "Default Organization" |
| 51 | + content_view: "CentOS Stream" |
| 52 | +''' |
| 53 | + |
| 54 | +RETURN = ''' |
| 55 | +content_view_histories: |
| 56 | + description: History of the Content View |
| 57 | + returned: success |
| 58 | + type: list |
| 59 | + elements: dict |
| 60 | +''' |
| 61 | + |
| 62 | +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloInfoAnsibleModule |
| 63 | + |
| 64 | + |
| 65 | +class KatelloContentViewHistoryInfo(KatelloInfoAnsibleModule): |
| 66 | + pass |
| 67 | + |
| 68 | + |
| 69 | +def main(): |
| 70 | + module = KatelloContentViewHistoryInfo( |
| 71 | + foreman_spec=dict( |
| 72 | + content_view=dict(required=True, scope=['organization'], type='entity', flat_name='id'), |
| 73 | + name=dict(invisible=True), |
| 74 | + ), |
| 75 | + ) |
| 76 | + |
| 77 | + with module.api_connection(): |
| 78 | + module.run() |
| 79 | + |
| 80 | + |
| 81 | +if __name__ == '__main__': |
| 82 | + main() |
0 commit comments