playbook - 執行yaml檔案的內容
inventory - 節點清單 (執行任務的位置)
moudule - 可使用的模組,如:ping、yum
plugin - 連線至控制端的方式,如:SNMP
role - 包含多個moudule的工作指令,可使用ansible-galaxy的社群搜尋其他人製作的role
$ yum install python3
$ pip3 install --upgrade pip
$ pip3 install ansible
$ ansible --version #檢查
Learn More →
$ ansible server -m ping -i benson-inventory --ask-pass
### ansible <client端名稱或ip> -m <module> -i <inventory檔案名稱>
--ask-pass:登入需要password
### 當ssh未提前交換key時,需要添加--ask-pass手動輸入密碼
$ ssh-keygen -t rsa -P "" #產生公、私鑰
$ ls ~/.ssh
authorized_keys #記錄別台主機提供的公鑰,可無須密碼登入
id_rsa #私鑰
id_rsa.pub #公鑰
known_hosts #ssh登入過主機的公鑰都會記錄,提高安全性
Learn More →
Learn More →
$ ansible-playbook benson-test.yml -i benson-inventory --ask-pass
###使用playbook讓client端完成指定task
Learn More →
$ automation-controller-service stop #停止aap服務
基礎Bash指令 $ whoami user $ command1 ; command2 output1 output2 $ !! #執行上一個command 硬連結 & 軟連結
Jan 31, 2023自從RHEL7以後,不再支援預設安裝docker,因此需要另外手動添加repository,安裝docker-ce(community edition)。 $ yum install docker #此項命令安裝的會是podman $ yum config-manager --add-rpeo=https://download.docker.com/linux/centos/docker-ce.repo $ yum install docker-ce $ docker --version
Jan 17, 2023LVM(Logic Volume Manager)邏輯磁區管理器 是Linux核心提供的功能,用於在硬碟分割區建立邏輯磁區,方便系統管理 :::success 優點 File System可以跨多個磁碟,因此大小不受物理磁碟限制 可以在系統運行時,動態擴展File System大小 可以新增磁碟至LVM儲存庫 ::: :::danger
Jan 5, 2023autofs是一個程式,實際由automount執行自動掛載。 可根據需要自動掛載指定的目錄,一段時間不用後會自動卸載。 rpcbind服務啟動在port 111 nfs服務啟動在port 2049 :bulb: 在掛載前需要有NFS連線,可使用showmount -e <IP>查看可掛載目錄 在NFS的 Client端有關autofs的設定檔共有2個:/etc/auto.master、/etc/auto.nfs(此名稱可自訂)
Dec 28, 2022or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up