salt配置管理
state格式:yaml 字尾:.sls 例如:web.sls
1、縮排 2個空格,不能使用tab
2、冒號 右邊有乙個空格
3、短橫線 (後面都有乙個空格)表示乙個列表
1、編寫乙個sls檔案
master開啟 file roots
然後重啟mastar
systemctl restart salt-master
目錄/srv/salt/需要手動單獨建立
新建salt目錄
mkdir /srv/salt/
mkdir /srv/salt/web
編寫乙個安裝apache的sls模組檔案
apache-install: #安裝
apache-service: #啟動
執行這個自定義的模組
定義乙個top file 執行模組,放在base目錄下。base目錄設定在file root目錄下。執行這個top file檔案他的作用是,可以定義哪些主機執行這個指定的模組。
1、 需要檢視salt執行這個操縱需要操作那些,然後在進行操作
[root@salt-node4 salt]# salt '2、 執行這狀態模組*' state.highstate test=true
[root@salt-node4 salt]# salt '*' state.highstate
saltstack配置管理
簡單配置 srv salt top.sls base ding ding.sls touch tmp foo cmd.run creates tmp foo結果 執行 當一切都準備好後,只需要 salt state.highstate 即可將sls應用到minion中。使用 salt state.h...
Saltstack配置管理
製作簡單初始化模組 在minion主機安裝軟體 1.定義master配置檔案file roots root localhost cat etc salt master file roots base etc salt states prod etc salt states prod 建立目錄 mkd...
Saltstack配置管理
製作簡單初始化模組 在minion主機安裝軟體 1.定義master配置檔案file roots root localhost cat etc salt master file roots base etc salt states prod etc salt states prod 建立目錄 mkd...