Remove openshift inventory plugin (#252)

* Remove openshift inventory plugin

This removes the openshift inventory plugin which has been deprecated
since version 3.0.0. The tests have been updated to retain coverage of
the connection plugin, which is still supported.

* Update version in Makefile

* CI fixes

* Update version info in build scripts

* Set ansible remote directory

The security policy on the pod is preventing ansible from writing to /.
Set it to /tmp which should be writable.
This commit is contained in:
Mike Graves
2025-05-05 11:55:22 -04:00
committed by GitHub
parent a3c3a69bbf
commit 93746f2392
7 changed files with 30 additions and 266 deletions

View File

@@ -14,12 +14,7 @@ provisioner:
log: true
options:
vvv: True
config_options:
inventory:
enable_plugins: community.okd.openshift
inventory:
hosts:
plugin: community.okd.openshift
host_vars:
localhost:
virtualenv: ${MOLECULE_EPHEMERAL_DIRECTORY}/virtualenv

View File

@@ -1,9 +1,31 @@
---
- name: Verify inventory and connection plugins
# This group is created by the openshift_inventory plugin
# It is automatically configured to use the `oc` connection plugin
- name: Create inventory of pods
# We need to manually create the inventory of pods now that the inventory plugin has been removed
gather_facts: false
hosts: localhost
connection: local
tasks:
- name: Get pods
kubernetes.core.k8s_info:
kind: Pod
namespace: testing
register: pods
- name: Add pods to inventory
ansible.builtin.add_host:
name: "{{ item.metadata.name }}"
groups:
- namespace_testing_pods
ansible_oc_pod: "{{ item.metadata.name }}"
ansible_oc_namespace: "{{ item.metadata.namespace }}"
pod_phase: "{{ item.status.phase }}"
ansible_remote_tmp: /tmp/.ansible
loop: "{{ pods.resources }}"
- name: Verify connection plugin
hosts: namespace_testing_pods
gather_facts: no
connection: community.okd.oc
vars:
file_content: |
Hello world