Closed guyyaakov1 closed 2 years ago
Changed func strip() to rstrip() The rstip function ignore the whitespace at the beginning of a string. The tests files:
-s test_cli_json.yml
name: var_eg
description: ""
provision:
- name: Laptop
groups: static-dummy
ip_address: 127.0.0.1
ansible_params:
ansible_connection: local
orchestrate:
- name: example
description: ...
orchestrator: ansible
hosts: localhost
ansible_playbook:
name: ansible/example.yml
ansible_options:
extra_vars:
file: ['variable_100.yml']
ansible/example.yml
- name: Example playbook
hosts: localhost
connection: local
tasks:
- debug:
msg: "{{ pods }}"
variable_100.yml
---
pods:
cont:
apiVersion: vSS1
kind: Pod
metadata: 123
annotations: 321
ansible.cfg
[defaults]
stdout_callback = yaml
bin_ansible_callbacks = True
Teflo Output:
2022-02-21 11:20:04,270 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] TASK [debug] *******************************************************************
2022-02-21 11:20:04,270 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] task path: /home/gyaakov/Work/test_var_json-20220109T112846Z-001/test_var_json/ansible/example.yml:8
2022-02-21 11:20:04,337 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] ok: [127.0.0.1] =>
2022-02-21 11:20:04,338 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] msg:
2022-02-21 11:20:04,338 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] cont:
2022-02-21 11:20:04,338 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] annotations: 321
2022-02-21 11:20:04,338 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] apiVersion: vSS1
2022-02-21 11:20:04,338 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] kind: Pod
2022-02-21 11:20:04,338 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] metadata: 123
2022-02-21 11:20:04,374 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] META: ran handlers
2022-02-21 11:20:04,412 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] META: ran handlers
2022-02-21 11:20:04,414 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569]
2022-02-21 11:20:04,415 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] PLAY RECAP *********************************************************************
2022-02-21 11:20:04,415 INFO [teflo.ansible_helpers.exec_local_cmd_pipe:569] 127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
``
LGTM this is the output: