devops's docs

2.3.0: example python解析yaml文件(ansible)


1. 安装模块

pip install pyyaml

2. 函数内容

import yaml

def yaml_parser(file):
    with open('file', 'r') as f:
        yml = yaml.load(f)[0]
return yml