Debian Codegraph @

ansible_collections/community/windows/plugins/modules/win_psrepository_info.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright: (c) 2020, Brian Scholer <@briantist>
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r'''
8 ---
9 module: win_psrepository_info
10 short_description: Gather information about PSRepositories
11 description:
12 - Gather information about all or a specific PSRepository.
13 options:
14 name:
15 description:
16 - The name of the repository to retrieve.
17 - Supports any wildcard pattern supported by C(Get-PSRepository).
18 - If omitted then all repositories will returned.
19 type: str
20 default: '*'
21 requirements:
22 - C(PowerShellGet) module
23 seealso:
24 - module: community.windows.win_psrepository
25 author:
26 - Brian Scholer (@briantist)
27 '''
28
29 EXAMPLES = r'''
30 - name: Get info for a single repository
31 community.windows.win_psrepository_info:
32 name: PSGallery
33 register: repo_info
34
35 - name: Find all repositories that start with 'MyCompany'
36 community.windows.win_psrepository_info:
37 name: MyCompany*
38
39 - name: Get info for all repositories
40 community.windows.win_psrepository_info:
41 register: repo_info
42
43 - name: Remove all repositories that don't have a publish_location set
44 community.windows.win_psrepository:
45 name: "{{ item }}"
46 state: absent
47 loop: "{{ repo_info.repositories | rejectattr('publish_location', 'none') | list }}"
48 '''
49
50 RETURN = r'''
51 repositories:
52 description:
53 - A list of repositories (or an empty list is there are none).
54 returned: always
55 type: list
56 elements: dict
57 contains:
58 name:
59 description:
60 - The name of the repository.
61 type: str
62 sample: PSGallery
63 installation_policy:
64 description:
65 - The installation policy of the repository. The sample values are the only possible values.
66 type: str
67 sample:
68 - Trusted
69 - Untrusted
70 trusted:
71 description:
72 - A boolean flag reflecting the value of C(installation_policy) as to whether the repository is trusted.
73 type: bool
74 package_management_provider:
75 description:
76 - The name of the package management provider for this repository.
77 type: str
78 sample: NuGet
79 provider_options:
80 description:
81 - Provider-specific options for this repository.
82 type: dict
83 source_location:
84 description:
85 - The location used to find and retrieve modules. This should always have a value.
86 type: str
87 sample: https://www.powershellgallery.com/api/v2
88 publish_location:
89 description:
90 - The location used to publish modules.
91 type: str
92 sample: https://www.powershellgallery.com/api/v2/package/
93 script_source_location:
94 description:
95 - The location used to find and retrieve scripts.
96 type: str
97 sample: https://www.powershellgallery.com/api/v2/items/psscript
98 script_publish_location:
99 description:
100 - The location used to publish scripts.
101 type: str
102 sample: https://www.powershellgallery.com/api/v2/package/
103 registered:
104 description:
105 - Whether the module is registered. Should always be C(True)
106 type: bool
107 '''