Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ioggstream opened this issue Nov 23, 2017 · 0 comments
Open

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

ioggstream opened this issue Nov 23, 2017 · 0 comments

Comments

@ioggstream
Copy link
Owner

  • 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant