Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelogs/fragments/refactor_k8s_inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
breaking_changes:
- k8s inventory - no longer adds services to lists of hosts (https://github.com/ansible-collections/community.kubernetes/pull/217).
- k8s inventory - removed the ``*_pods`` groups, as pods are the only valid hosts anyway (https://github.com/ansible-collections/community.kubernetes/pull/217).
minor_changes:
- k8s inventory - group names are now sanitized (https://github.com/ansible-collections/community.kubernetes/pull/217).
- k8s inventory - add new groups for Deployments, Daemonsets and StatefulSets, allowing
easy access to pods that are created by those resources (https://github.com/ansible-collections/community.kubernetes/pull/217).
- k8s inventory - move extract_selector method to common (https://github.com/ansible-collections/community.kubernetes/pull/217).
17 changes: 5 additions & 12 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
k8s:
api_version: v1
kind: Namespace
name: inventory
name: inventory-ns

- name: Add a deployment
k8s:
Expand All @@ -49,7 +49,7 @@
kind: Deployment
metadata:
name: inventory
namespace: inventory
namespace: inventory-ns
spec:
replicas: 1
selector:
Expand All @@ -72,21 +72,14 @@
- meta: refresh_inventory

- name: Verify inventory and connection plugins
hosts: namespace_inventory_pods
gather_facts: no
hosts: namespace_inventory_ns_deployment_inventory
gather_facts: yes

vars:
file_content: |
Hello world

tasks:
- name: End play if host not running (TODO should we not add these to the inventory?)
meta: end_host
when: pod_phase != "Running"

- debug: var=hostvars
- setup:

- debug: var=ansible_facts

- name: Assert the TEST environment variable was retrieved
Expand Down Expand Up @@ -116,5 +109,5 @@
k8s:
api_version: v1
kind: Namespace
name: inventory
name: inventory-ns
state: absent
Loading