小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

CentOS 7 上安裝和配置Ansible(Windows服務(wù)器)

 寒冰秋水 2018-12-15

 Ansible是一種用于自動(dòng)化任務(wù)的開源工具。它管理LinuxWindows服務(wù)器的配置。它在沒有代理的情況下工作,這意味著Ansible使用SSH和當(dāng)前用戶SSH授權(quán)。

你可以使用Ansible自動(dòng)化三種類型的任務(wù): 

配置:在基礎(chǔ)設(shè)施中設(shè)置幾個(gè)需要的服務(wù)器。

配置管理:更改應(yīng)用程序、操作系統(tǒng)或設(shè)備的配置;啟動(dòng)和停止服務(wù);安裝或更新應(yīng)用程式;實(shí)現(xiàn)安全策略或執(zhí)行各種其他配置任務(wù)。

應(yīng)用程序部署:通過將內(nèi)部開發(fā)的應(yīng)用程序的部署自動(dòng)化到生產(chǎn)系統(tǒng),使DevOps更容易。

本文將指導(dǎo)您完成CentOS 7Ansible的安裝和安裝過程,以及在Windows服務(wù)器上運(yùn)行的計(jì)算機(jī)的管理配置。

 

先決條件

sudo用戶。

CentOS 7服務(wù)器實(shí)例。

安裝

添加EPEL存儲(chǔ)庫(kù)。

sudo yum install epel-release

更新包。

sudo yum -y update

一旦包被更新,用yum安裝Ansible。

sudo yum -y install ansible

要管理您的Windows服務(wù)器,您需要安裝以下軟件包:

  • python-pip
  • pip
  • pywinrm

安裝Python包。

sudo yum -y install python-pip pip

安裝WinRM (Windows遠(yuǎn)程管理)。

pip install pywinrm

通過使用以下命令檢索其版本來(lái)測(cè)試Ansible安裝。

 

ansible --version
ansible 2.5.5
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

配置Ansible用于Windows服務(wù)器管理

 

Ansible目錄。

cd /etc/ansible

使用您最喜歡的文本編輯器編輯hosts文件。

nano hosts

windows組的底部添加以下代碼行。

[windows]
server1.domain.local
server1.domain.local

有必要?jiǎng)?chuàng)建一個(gè)加密的保險(xiǎn)庫(kù),其中包含Windows服務(wù)器的訪問標(biāo)識(shí)符。為此,我們將創(chuàng)建一個(gè)新的加密yml文件。文件名必須與應(yīng)用它的主機(jī)組匹配。在我們的示例中,創(chuàng)建的組稱為windows,因此文件將是windows.yml。

mkdir group_vars
cd group_vars
ansible-vault create windows.yml

在您的yml文件中,添加以下參數(shù)。

ansible_ssh_user: _your_ssh_user_
ansible_ssh_pass: _your_ssh_pass_
ansible_ssh_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore

配置Windows服務(wù)器

 

可以使用PowerShell腳本自動(dòng)配置計(jì)算機(jī)。該腳本將自動(dòng)配置WinRM (Windows遠(yuǎn)程管理)并打開防火墻。

 

Github下載PowerShell腳本。

 

修改PowerShell腳本的執(zhí)行規(guī)則,以允許執(zhí)行腳本。

Set-ExecutionPolicy RemoteSigned

執(zhí)行該腳本。

.\ConfigureRemotingForAnsible.ps1

您的Windows服務(wù)器現(xiàn)在可以用Ansible進(jìn)行遠(yuǎn)程管理了。


文章轉(zhuǎn)載于:https://www./jiaocheng.html

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多