我試圖用Ansible運行以下兩個命令:如何運行apt更新,並通過Ansible外殼升級
sudo apt-get update && sudo apt-get upgrade -y
我知道有ansible你可以使用:
ansible all -m shell -u user -K -a "uptime"
會運行下面的命令嗎?或者我必須使用raw
命令
ansible all -m shell -u user -K -a "sudo apt-get update && sudo apt-get upgrade -y"
你試過了嗎?你爲什麼喜歡這個與內置的'apt'模塊? – tedder42
我是剛剛嘗試理解的新手,我會對apt模塊做出承諾,但不確定是否也升級了? – nadermx