Skip to content

To_nice_yaml reorders saved yaml at persist. #53

@Roiki11

Description

@Roiki11
SUMMARY

To_nice_yaml filter in persist task reorders the keys by default. This makes the output more difficult to read and different from what ansible shows with gather action.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

content: "{{ {res: result['gathered']} | to_nice_yaml }}"

STEPS TO REPRODUCE

Without sort_keys=false the output gets messed from the expected output shown with gather. Adding it produces expected output when compared to the output displayed by gather function. Examples below.

EXPECTED RESULTS
interfaces:
  - name: AppGigabitEthernet1/0/1
    enabled: false
  - name: FortyGigabitEtherneti/1/1
    enabled: false
  - name: FortyGigabitEthernet1/1/2
    enabled: false
  - name: GigabitEthernet0/0
    description: Management interface
    enabled: true
ACTUAL RESULTS
interfaces:
 - enabled: false
   name: AppGigabitEthernet1/0/1
 - enabled: false
   name: FortyGigabitEthernet1/1/1
 - enabled: false
   name: FortyGigabitEthernet1/1/2
 - description: Management interface
   enabled: true
   name: GigabitEthernet0/0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions