天天看點

Linux企業實戰-ansible(25)setup、debug

利用setup傳回遠端主機的資訊

Linux企業實戰-ansible(25)setup、debug

截取部分含mb字母的

Linux企業實戰-ansible(25)setup、debug

如何自定義資訊

首先建立一個預設目錄

Linux企業實戰-ansible(25)setup、debug
Linux企業實戰-ansible(25)setup、debug

建立一個清單

Linux企業實戰-ansible(25)setup、debug
Linux企業實戰-ansible(25)setup、debug

過濾主機自定義的資訊

Linux企業實戰-ansible(25)setup、debug

debug子產品

Linux企業實戰-ansible(25)setup、debug

調用debug子產品結合變量應用如下

Linux企業實戰-ansible(25)setup、debug

當變量裡面包含特殊符号是必須使用引号否則會報錯

Linux企業實戰-ansible(25)setup、debug

載入我們如果想擷取ansible_memory_mb的資訊

Linux企業實戰-ansible(25)setup、debug

然後運作就會發現擷取他的資訊了

Linux企業實戰-ansible(25)setup、debug
Linux企業實戰-ansible(25)setup、debug

繼續閱讀