MCの飄狂山莊㊣

What’s the Worst That Could Happen?

[筆記] Ansible how to use 'list' in yaml file

2018-11-27 筆記 Eric Chang

這幾天在玩ansible 時,碰到一個問題

假如我有個yaml檔作為資料來源,檔名是 abc.yml

大概長這樣

    "teams": [
        {
            "chinese_name": "TEAM1",
            "description": "TEAM1",
            "gid": 10125,
            "location": [
                "hq"
            ],
            "name": "aa",
            "users": [
                "chen",
                "chou",
                "huani",
                "yey",
                "wa"
            ]
        },
        {
            "chinese_name": "TEAM2",
            "description": "TEAM2",
            "gid": 10126,
            "location": [
                "hq"
            ],
            "name": "bb",
            "users": [
                "chhiao",
                "chgc",
                "chy",
                "hsi",
                "li",
                "li",
                "chgchi"
            ]
        }
		]