I want to pass a variable in the Jinja file template and use it as src for the community.kubernetes.k8s
module
- name: deploy the config-file
community.kubernetes.k8s:
state: present
src: templates/fluentbit-config.yml.j2
fluentbit-config.yml.j2
is below:
apiVersion: logging.kubesphere.io/v1alpha2
kind: FluentBitConfig
metadata:
name: "{{ fluentBitConfigName }}"
namespace: kubesphere-logging-system
labels:
app.kubernetes.io/name: fluent-bit
spec:
inputSelector:
matchLabels:
logging.kubesphere.io/enabled: "true"
outputSelector:
matchLabels:
logging.kubesphere.io/enabled: "true"
It is not able to the variable from the defaults.