### [筆記] 還是 Ansible Selectattr

2018-11-29 筆記 Eric Chang

在上一篇 Ansible how to use ‘list’ in yaml file

有提到怎麼用 with_items / set_fact 來取得在yaml 檔案中的清單

不過就是有點醜

Continue reading

### [筆記] 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"
                ]
            }
    		]

Continue reading
© 2017 by Lednerb - RSS
Bilberry Hugo Theme