Open mcexit opened 2 years ago
@mcexit can you please post an example of what you would like to have? What can be in stdin?
An example is whatever manifest you want to pass to podman_play (akin to kustomize build <path> | podman play kube -
. This could be created with the kubernetes.core.kustomize
Ansible lookup module:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.podman.io/device: syncthing/files
volume.podman.io/mount-options: bind
labels:
app.kubernetes.io/component: server
app.kubernetes.io/created-by: podman
app.kubernetes.io/managed-by: kustomize-4.5.7
app.kubernetes.io/name: syncthing
app.kubernetes.io/part-of: examples
app.kubernetes.io/version: official
name: podman-syncthing
namespace: examples
spec:
volumeName: syncthing
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
volume.podman.io/device: syncthing/files
volume.podman.io/mount-options: bind
labels:
app.kubernetes.io/component: server
app.kubernetes.io/created-by: podman
app.kubernetes.io/managed-by: kustomize-4.5.7
app.kubernetes.io/name: syncthing
app.kubernetes.io/part-of: examples
app.kubernetes.io/version: official
name: podman-syncthing
namespace: examples
spec:
selector:
matchLabels:
app.kubernetes.io/component: server
app.kubernetes.io/created-by: podman
app.kubernetes.io/name: syncthing
app.kubernetes.io/part-of: examples
app.kubernetes.io/version: official
template:
metadata:
annotations:
volume.podman.io/device: syncthing/files
volume.podman.io/mount-options: bind
labels:
app.kubernetes.io/component: server
app.kubernetes.io/created-by: podman
app.kubernetes.io/name: syncthing
app.kubernetes.io/part-of: examples
app.kubernetes.io/version: official
spec:
containers:
- image: syncthing/syncthing
name: syncthing
ports:
- containerPort: 8384
hostIP: 127.0.0.1
hostPort: 8384
- containerPort: 21027
hostPort: 21027
protocol: UDP
- containerPort: 22000
hostPort: 22000
protocol: TCP
- containerPort: 22000
hostPort: 22000
protocol: UDP
volumeMounts:
- mountPath: /var/syncthing
name: syncthing
volumes:
- name: syncthing
persistentVolumeClaim:
claimName: podman-syncthing
An example is whatever manifest you want to pass to podman_play (akin to
kustomize build <path> | podman play kube -
. This could be created with thekubernetes.core.kustomize
Ansible lookup module:
I'd like to understand how would look ansible task with it. Can you please provide a desired example? Like registering stdout
from kustomize or something else?
That is one possibility, but there is a kustomize lookup module already in ansible:
https://docs.ansible.com/ansible/latest/collections/kubernetes/core/kustomize_lookup.html
So it would look like:
- name: Play kube file
containers.podman.podman_play:
stdin: "{{ lookup('kubernetes.core.kustomize', dir='/path/to/kustomization') }}"
You could even use "{{ lookup('template', 'somefile.yaml') }}"
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
podman_play module only allows file input.
Describe the results you received: podman_play only allows file input using
kube_file
which is required.Describe the results you expected: podman_play module should allow for variable input, not just file. This allows the utilization of something like
kubernetes.core.kustomize lookup
Version of the
containers.podman
collection: Either git commit if installed from git:git show --summary
Or version fromansible-galaxy
if installed from galaxy:ansible-galaxy collection list | grep containers.podman
Output of
ansible --version
:Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.): physical