1. 程式人生 > >ansible安裝測試

ansible安裝測試

user模組:

目的:在指定節點上建立一個使用者名稱為nolinux,組為nolinux的使用者

命令:

新增使用者:

# ansible mysqldb -m user -a 'name=nolinux groups=nolinux state=present'

# ansible mysqldb -a 'id nolinux'

刪除使用者:

# ansible mysqldb -m user -a 'name=nolinux state=absent remove=yes'

# ansible mysqldb -a 'id nolinux'

------------------------------------------------------------------------

ansible mysqldb -m user -a 'name=ansible state=present'               ----建立使用者ansible

ansible mysqldb -m raw -a 'echo 123456|passwd --stdin ansible'    ----修改密碼為123456

------------------------------------------------------------------------

yum模組:

目的:在指定節點上安裝 lrzsz 服務

命令:

# ansible mysqldb -m yum -a "state=present name=lrzsz"

service模組:

目的:啟動指定節點上的 puppet 服務,並讓其開機自啟動

命令:

# ansible mysqldb -m service -a 'name=puppet state=restarted enabled=yes'

script模組:

目的:在指定節點上執行/root/a.sh指令碼(該指令碼是在ansible控制節點上的)

命令:ansible mysqldb -m script -a '/root/a.sh

raw模組:

    目的:在10.1.1.113節點上執行hostname命令

    命令:ansible 10.1.1.113 -m raw-a 'hostname|tee'

get_url模組:

    命令:ansible 10.1.1.113 -m get_url -a 'url=http://10.1.1.116/favicon.ico dest=/tmp'

synchronize模組:

    目的:將主控方/root/a目錄推送到指定節點的/tmp目錄下

    命令:ansible 10.1.1.113 -m synchronize -a 'src=/root/a dest=/tmp/ compress=yes'

    執行效果:

delete=yes   使兩邊的內容一樣(即以推送方為主)

compress=yes  開啟壓縮,預設為開啟

--exclude=.git  忽略同步.git結尾的檔案


相關推薦

ansible安裝測試

user模組: 目的:在指定節點上建立一個使用者名稱為nolinux,組為nolinux的使用者 命令: 新增使用者: # ansible mysqldb -m user -a 'name=nolinux groups=nolinux state=present' # ansible mysql

ansible安裝部署及測試

(1)下載pip(2)解壓安裝解壓下載的檔案(windows下只用解壓工具解壓如RAR,Linux下終端輸入tar -xf pip-9.0.1.tar.gz,即tar -xf 檔名),進入解壓後的資料夾中,調出命令列視窗或者終端,windows下輸入python setup.

Ansible(一):Ansible安裝測試

摘要 本文主要內容是介紹Ansible的安裝及測試,文章內容主要摘自Ansible的文件。 背景 公司近期開發分散式採集伺服器,儘管當前測試僅由三臺伺服器組成,但是規劃中會有近百臺伺服器一起工作。這就需要有一種方法或者工具可以批量管理整個叢集,舉個最簡

ansible安裝tomcat8 最終版

ansible假如你要在一臺機器安裝多個tomcat或者安裝多臺tomcat,你可以選擇假設現在tomcat有三個,分別為cxx,wxx,sxx多建立對應的yml文件,一個項目一個copy.yml,install.yml,delete.yml 分別一個我選擇第二種方法,變量可以定義在一個文件中借用ansibl

Centos下Sphinx中文分詞編譯安裝測試---CoreSeek

orm 創建索引 auxiliary aclocal memcache acl inux mage arch 要支持中文分詞,還需要下載Coreseek,可以去官方搜索下載,這裏我用的4.1 百度雲下載地址: https://pan.baidu.com/s/1sl

ansible安裝方法

linux 默認 沒有 clone 運行 tag 分發 limit 新版 一 需要安裝些什麽 Ansible默認通過 SSH 協議管理機器. 安裝Ansible之後,不需要啟動或運行一個後臺進程,或是添加一個數據庫.只要在一臺電腦(可以是一臺筆記本)上安裝好,就可以通

ansible安裝nginx (tengine)

nginx haproxy tengine ansible # 接上篇 http://xiong51.blog.51cto.com/5239058/1941193 ansible管理機:192.168.8.35 名稱:kicktomcat主機: 192.168.8.244,192.168

ansible安裝drbd+nfs+keepalived

nfs keepalived drbd keepalived不搶占 ansible管理機:192.168.8.35 名稱:kicktomcat主機: 192.168.8.234,192.168.8.235 VIP : 192.168.8.100系統版本: Centos7.2##### 實

Miniconda 安裝測試

dir 1-1 expec part nes blog pda 分享 otherwise 背景:   conda 是一個python的計算環境,minicoda 可以看做是conda的精簡版 官網:     https://conda.io/miniconda.html

使用Ansible安裝部署nginx+php+mysql

private restart keepalive pri pes cts err document fault 前提: 1、已配置好hosts文件且免密碼登錄 2、需要的yaml文件已上傳到主控端 一、使用Ansible安裝nginx 1、nginx.yaml文件 1

ftp服務器和http服務器的簡單安裝測試

install sss blog rep onf ftp services 工作目錄 默認 0.【 安裝前的準備工作:】 1)chkconfig iptables off或service iptables stop 禁防火墻(centos6) syste

ansible安裝

版本 log c++ ins 多人 file com requires load 一.升級python 作者系統為centos6.5,系統默認安裝python2.6,雖然ansible官方文檔要求python版本為2.6或2.7,然而許多人都說使用2.6可能出現一系列問題

ansible 安裝和使用

htm ansi .html 測試 style ble project fedora 安裝和使用 ## 安裝epel 源: 1 rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.no

一、python特性+python安裝測試

追加 寫代碼 通過 直接 編寫代碼 str 系統 執行 令行 解釋性    當你使用C或者C++語言編寫程序時,需要通過編譯器將源代碼編譯成電腦能夠識別的語言(二進制機器碼)。當運行這些程序時候,連接器將會從硬盤中將編譯好的程序從硬盤中拷貝到內存中運行。   python:

kafka-zk-安裝測試初體驗

nbsp zookeepe a-z lar start 依賴 eat ati 服務 第一步: 安裝 安裝工具brew install kafka 會自動安裝依賴zookeeper 註:安裝配置文件位置 /usr/local/etc/kafka|zookeeper

sbt的安裝測試

home dep 使用 exe pen 行程 switch $@ int 1.下載 wget https://github.com/sbt/sbt/releases/download/v0.13.15/sbt-0.13.15.tgz 2.安裝 tar -zxvf sbt-

Linux - ansible 安裝

sts one 解決方法 現象 sta not git clone etc uil # 安裝依賴 yum install rpm-build python2-devel sshpass PyYAML python-jinja2 python-paramiko python

nginx_lua_waf安裝測試

waf ngx_lua_waf ngx_lua_waf是一個基於lua-nginx-module(openresty)的web應用防火墻,對於中小企業或不願購置硬件防火墻的企業的首選,能有效保證網站的安全性。 源碼:https://github.com/loveshell/ngx_lua_waf0x1

Kbengine遊戲引擎-【4】demo-kbengine_unity3d_demo 在容器docker上安裝測試

目錄文件 關於 linux cnblogs 關註 容器 註意 中文 nbsp git地址:https://github.com/kbengine/kbengine_unity3d_demo Demo中文地址:https://github.com/kbengine/kbeng

Ubuntu下Python安裝測試 & Geany實現Hello World!

pri images 突出 markdown 應該 打開 sta cnblogs ubunt Python是一種跨平臺的編程語言,能在所有主要操作系統下運行。Linux是為編程而設計的操作系統,因此在大多數裝了ubuntu的計算機應該默認裝了Python。 為了確定是否確實