Debian Codegraph @

ansible_collections/community/okd/README.md

raw
1 # OKD Collection for Ansible
2
3 This repo hosts the `community.okd` Ansible Collection.
4
5 ## Description
6 The collection includes a variety of Ansible content to help automate the management of applications in OKD clusters, as well as the provisioning and maintenance of clusters themselves.
7
8 <!--- STARTREMOVE --->
9 [![CI](https://github.com/ansible-collections/community.okd/workflows/CI/badge.svg?event=push)](https://github.com/ansible-collections/community.okd/actions) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.okd)](https://codecov.io/gh/ansible-collections/community.okd)
10
11 ## Communication
12
13 * Join the Ansible forum:
14 * [Get Help](https://forum.ansible.com/c/help/6): get help or help others.
15 * [POSTS TAGGED WITH 'YOUR TAG'](https://forum.ansible.com/tag/YOUR_TAG): subscribe to participate in collection-related conversations.
16 * [REFER TO YOUR FORUM GROUP HERE IF EXISTS](https://forum.ansible.com/g/): by joining the team you will automatically get subscribed to the posts tagged with [your group forum tag here](https://forum.ansible.com/tags).
17 * [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
18 * [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
19
20 * The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
21
22 For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
23
24 ## Requirements
25
26 <!--start requires_ansible-->
27 ### Ansible version compatibility
28
29 This collection has been tested against following Ansible versions: **>=2.15.0**.
30
31 Please ensure to update the `network_os` to use the fully qualified collection name (for example, `cisco.ios.ios`).
32 Plugins and modules within a collection may be tested with only specific Ansible versions.
33 A collection may contain metadata that identifies these versions.
34 PEP440 is the schema used to describe the versions of Ansible.
35 <!--end requires_ansible-->
36
37 ### Python Support
38
39 * Collection supports 3.9+
40
41 ### Kubernetes Version Support
42
43 This collection supports Kubernetes versions >=1.24.
44
45 ### Included content
46
47 Click on the name of a plugin or module to view that content's documentation:
48
49 <!--start collection content-->
50 #### Connection plugins
51 Name | Description
52 --- | ---
53 [community.okd.oc](https://github.com/openshift/community.okd/blob/main/docs/community.okd.oc_connection.rst)|Execute tasks in pods running on OpenShift.
54
55 #### Inventory plugins
56 Name | Description
57 --- | ---
58 [community.okd.openshift](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_inventory.rst)|OpenShift inventory source
59
60 #### Modules
61 Name | Description
62 --- | ---
63 [community.okd.k8s](https://github.com/openshift/community.okd/blob/main/docs/community.okd.k8s_module.rst)|Manage OpenShift objects
64 [community.okd.openshift_adm_groups_sync](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_adm_groups_sync_module.rst)|Sync OpenShift Groups with records from an external provider.
65 [community.okd.openshift_adm_migrate_template_instances](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_adm_migrate_template_instances_module.rst)|Update TemplateInstances to point to the latest group-version-kinds
66 [community.okd.openshift_adm_prune_auth](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_adm_prune_auth_module.rst)|Removes references to the specified roles, clusterroles, users, and groups
67 [community.okd.openshift_adm_prune_builds](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_adm_prune_builds_module.rst)|Prune old completed and failed builds
68 [community.okd.openshift_adm_prune_deployments](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_adm_prune_deployments_module.rst)|Remove old completed and failed deployment configs
69 [community.okd.openshift_adm_prune_images](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_adm_prune_images_module.rst)|Remove unreferenced images
70 [community.okd.openshift_auth](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_auth_module.rst)|Authenticate to OpenShift clusters which require an explicit login step
71 [community.okd.openshift_build](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_build_module.rst)|Start a new build or Cancel running, pending, or new builds.
72 [community.okd.openshift_import_image](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_import_image_module.rst)|Import the latest image information from a tag in a container image registry.
73 [community.okd.openshift_process](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_process_module.rst)|Process an OpenShift template.openshift.io/v1 Template
74 [community.okd.openshift_registry_info](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_registry_info_module.rst)|Display information about the integrated registry.
75 [community.okd.openshift_route](https://github.com/openshift/community.okd/blob/main/docs/community.okd.openshift_route_module.rst)|Expose a Service as an OpenShift Route.
76
77 <!--end collection content-->
78
79 <!--- ENDREMOVE --->
80
81 ## Installation
82
83 ### Installing the Collection from Ansible Galaxy
84
85 Before using the OKD collection, you need to install it with the Ansible Galaxy CLI:
86
87 ansible-galaxy collection install community.okd
88
89 You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:
90
91 ```yaml
92 ---
93 collections:
94 - name: community.okd
95 version: 4.0.2
96 ```
97
98 ### Installing the Kubernetes Python Library
99
100 Content in this collection requires the [Kubernetes Python client](https://pypi.org/project/kubernetes/) to interact with Kubernetes' APIs. You can install it with:
101
102 pip3 install kubernetes
103
104 ## Use Cases
105
106 ### Using modules from the OKD Collection in your playbooks
107
108 It's preferable to use content in this collection using their Fully Qualified Collection Namespace (FQCN), for example `community.okd.openshift`:
109
110 ```yaml
111 ---
112 plugin: community.okd.openshift
113 connections:
114 - namespaces:
115 - testing
116 ```
117
118 For documentation on how to use individual plugins included in this collection, please see the links in the 'Included content' section earlier in this README.
119
120 ### Ansible Turbo mode Tech Preview
121
122 The `community.okd` collection supports Ansible Turbo mode as a tech preview via the `cloud.common` collection. By default, this feature is disabled. To enable Turbo mode, set the environment variable `ENABLE_TURBO_MODE=1` on the managed node. For example:
123
124 ```yaml
125 ---
126 - hosts: remote
127 environment:
128 ENABLE_TURBO_MODE: 1
129 tasks:
130 ...
131 ```
132
133 Please read more about Ansible Turbo mode - [here](https://github.com/ansible-collections/community.okd/blob/main/docs/ansible_turbo_mode.rst).
134
135 <!--- STARTREMOVE --->
136 ## Contributing to the collection
137
138 If you want to develop new content for this collection or improve what's already here, the easiest way to work on the collection is to clone it into one of the configured [`COLLECTIONS_PATHS`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths), and work on it there.
139
140 See [Contributing to community.okd](CONTRIBUTING.md).
141
142 ## Testing
143
144 The `tests` directory contains configuration for running sanity tests using [`ansible-test`](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html).
145
146 You can run the `ansible-test` sanity tests with the command:
147
148 make test-sanity
149
150 The `molecule` directory contains configuration for running integration tests using [`molecule`](https://molecule.readthedocs.io/).
151
152 You can run the `molecule` integration tests with the command:
153
154 make test-integration
155
156 These commands will create a directory called `ansible_collections` which should not be committed or added to the `.gitignore` (Tracking issue: https://github.com/ansible/ansible/issues/68499)
157
158
159 ### Prow
160
161 This repository uses the OpenShift [Prow](https://github.com/kubernetes/test-infra/blob/master/prow/README.md) instance for testing against live OpenShift clusters.
162 The configuration for the CI jobs that this repository runs can be found in the [`openshift/release repository`](https://github.com/openshift/release/blob/master/ci-operator/config/openshift/community.okd/openshift-community.okd-main.yaml).
163
164 The [Prow CI integration test job](https://github.com/openshift/release/blob/master/ci-operator/config/openshift/community.okd/openshift-community.okd-main.yaml#L40-L43)
165 runs the command:
166
167 make test-integration-incluster
168
169 which will create a job that runs the normal `make integration` target. In order to mimic the Prow CI job, you must
170 first build the test image using the Dockerfile in [`ci/Dockerfile`](ci/Dockerfile). Then, push the image
171 somewhere that it will be accessible to the cluster, and run
172
173 IMAGE_FORMAT=<your image> make test-integration-incluser
174
175 where the `IMAGE_FORMAT` environment variable is the full reference to your container (ie, `IMAGE_FORMAT=quay.io/example/molecule-test-runner`)
176
177 ## Publishing New Versions
178
179 Releases are automatically built and pushed to Ansible Galaxy for any new tag. Before tagging a release, make sure to do the following:
180
181 1. Update the version in the following places:
182 * a. The `version` in `galaxy.yml`
183 * b. This README's `requirements.yml` example
184 * c. The `DOWNSTREAM_VERSION` in `ci/downstream.sh`
185 * d. The `VERSION` in `Makefile`
186 * e. The version in `requirements.yml`
187 2. Update the CHANGELOG:
188 * 1. Make sure you have [`antsibull-changelog`](https://pypi.org/project/antsibull-changelog/) installed.
189 * 2. Make sure there are fragments for all known changes in `changelogs/fragments`.
190 * 3. Run `antsibull-changelog release`.
191 3. Commit the changes and create a PR with the changes. Wait for tests to pass, then merge it once they have.
192 4. Tag the version in Git and push to GitHub.
193
194 After the version is published, verify it exists on the [OKD Collection Galaxy page](https://galaxy.ansible.com/community/okd).
195 <!--- ENDREMOVE --->
196
197 ## Support
198
199 <!--List available communication channels. In addition to channels specific to your collection, we also recommend to use the following ones.-->
200
201 We announce releases and important changes through Ansible's [The Bullhorn newsletter](https://github.com/ansible/community/wiki/News#the-bullhorn). Be sure you are [subscribed](https://eepurl.com/gZmiEP).
202
203 We take part in the global quarterly [Ansible Contributor Summit](https://github.com/ansible/community/wiki/Contributor-Summit) virtually or in-person. Track [The Bullhorn newsletter](https://eepurl.com/gZmiEP) and join us.
204
205 For more information about communication, refer to the [Ansible Communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
206
207 For the latest supported versions, refer to the release notes below.
208
209 If you encounter issues or have questions, you can submit a support request through the following channels:
210 - GitHub Issues: Report bugs, request features, or ask questions by opening an issue in the [GitHub repository](https://github.com/openshift/community.okd/).
211
212 ## Release notes
213
214 See the [raw generated changelog](https://github.com/openshift/community.okd/blob/main/CHANGELOG.rst).
215
216 ## More Information
217
218 For more information about Ansible's Kubernetes and OpenShift integrations, join the `#ansible-kubernetes` channel on [libera.chat](https://libera.chat/) IRC, and browse the resources in the [Kubernetes Working Group](https://github.com/ansible/community/wiki/Kubernetes) Community wiki page.
219
220 ## Code of Conduct
221
222 We follow the [Ansible Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html) in all our interactions within this project.
223
224 If you encounter abusive behavior, please refer to the [policy violations](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html#policy-violations) section of the Code for information on how to raise a complaint.
225
226 ## License
227
228 GNU General Public License v3.0 or later
229
230 See LICENCE to see the full text.