Skip to content

ansible-101: use only yaml module in course #31

@ioggstream

Description

@ioggstream
  • use only yaml module (it's a json superset)

  • show safe_dump

  • show ipython_cat.s

data= !cat /tmp/foo/localhost

import yaml

data_structure = yaml.load(data.s)

ansible_mounts = data_structure['ansible_facts']['ansible_mounts']

yaml_string = yaml.safe_dump(ansible_mounts, default_flow_style=0)

print(yaml_string)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions