当前位置: 首页 > news >正文

国内很多网站不是响应式俄文网站

国内很多网站不是响应式,俄文网站,全网营销张启明,如何建设外贸网站目录 一、理论 1. Ansible 2.部署Ansible自动化运维工具 3.Ansible常用模块 4.hostsinverntory主机清单 二、实验 1.部署Ansible自动化运维工具 2.ansible 命令行模块 3.hostsinverntory主机清单 三、问题 1. ansible远程shell失败 2.组变量查看webservers内主机ip报…目录 一、理论 1. Ansible 2.部署Ansible自动化运维工具 3.Ansible常用模块 4.hostsinverntory主机清单 二、实验 1.部署Ansible自动化运维工具 2.ansible 命令行模块 3.hostsinverntory主机清单 三、问题 1. ansible远程shell失败 2.组变量查看webservers内主机ip报错 ​编辑 3.组嵌套查看webs内主机ip报错 四、总结 一、理论 1. Ansible 1概念 Ansible是基于模块工作的只是提供了一种运行框架本身没有完成任务的能力真正操作的是Anisble的模块。每个模块都是独立的、实现了批量系统配置、批量程序部署、批量运行命令等功能。 Ansible是一款简洁、高效的运维自动化工具。只需要将ansible安装在主控机器上就可以通过SSH协议实现针对大量受管服务器的批量化、剧本化的管理。通过过Ansible实现远程控制,主控机被控机通过SSH实现。基于Python开发集合了众多运维工具puppet、cfengine、chef、func、fabric的优点实现了批量系统配置、批量程序部署、批量运行命令等功能。   2架构 Ansible架构中有两种计算机类型,即控制节点和受管主机。 Ansible在控制节点上安装和运行,计算机上也含有Ansible项目文件的副本。控制节点可以是管理员的笔记本电脑、多个管理员共享的系统,或者运行红帽Ansible Tower的服务器。         受管主机列在清单中,清单还可以将这些系统组织到组中,以便于集中管理。清单可以在静态文本文件中定义,或者通过从外部来源获取信息的脚本来动态确定。 Ansible用户无需编写复杂的脚本,而只要创建高级别play即可确保主机或主机组处于特定状态。 Play按该play指定的顺序对主机执行一系列任务。这些play通过采用YAML格式的文本文件来表达。包含一个或多个play的文件称为playbook。        每个任务运行一个模块,即(使用Python, Powershell或某种其他语言编写的)一小段代码。各个模块基本上是您的工具包中的一个工具。Ansible随附了数百个实用模块,它们能够执行许多不同的自动化任务。它们可以作用于系统文件,安装软件或者进行AP调用。 在任务中使用时,模块通常确保计算机的某一特定方面处于特定的状态。例如,使用某一模块的任务可以确保某一文件存在且具有特定的权限和内容,而使用另一不同模块的任务可确保已挂载特定的文件系统。如果系统不处于指定的状态,任务应将它置于该状态。如果系统已处于该状态,则不执行任何操作。如果任务失败, Ansible的默认行为是对发生了错误的主机中止playbook的其余部分。 QA任务、play和playbook设计为具有幂等性。这意味着,您可以在相同主机上多次安全地运行一个playbooko当您的系统处于正确状态时, playbook在运行时不会进行任何更改。这意味着,您应该能够在相同主机上多次安全地运行一个playbook。当您的系统处于正确状态时, playbook在运行时不应进行任何更改。您可以使用多个模块来运行任意命令。但是,您必须小心使用这些模块,以确保它们以幂等方式运行。 Ansible也使用插件。插件是您可以添加到Ansible中的代码,以对它进行扩展并使它适合新的用途和平台。 Ansible架构是无代理的。通常,当管理员运行Ansible Playbook或临时命令时,控制节点使用SSH (默认)或WinRM连接受管主机。这意味着客户端无需在受管主机上安装特定于Ansible的代理,也不需要允许将特殊的网络流量传输到某一非标准端口。 3特点 ①部署简单只需要主控端部署Ansible环境被控端无需做任何操作 ②默认使用SSH协议设备进行管理 ③主从集中化管理 ④配置简单、功能强大、扩展性强 ⑤支持API及自定义模块可以通过Python轻松扩展 ⑥通过playbooks来定制强大的配置、状态管理 ⑦对云平台和大数据都有很好的支持   4优势 ①轻便性无需在被控制服务器上安装客户端Ansible基于ssh协议 ②幂等性大部分模块有幂等性即如果输入systemctl stop firewalld当发现要停止的服务已经停止就不会做任何操作了多次停止不会改变结果。systemtl restart是非幂等的。 ③判断性大部分模块在执行时都会判断目标节点是否要执行任务所有重复执行某个任务大部分时间不会产生副作用 ④简介性一个窗口即可管理所有需要控制的机器无需开启多个窗口   5核心程序 ①HostInventory记录由Ansible管理的主机信息端口ip密码等 ②playbooks剧本YAML格式文件多任务定义在一个文件中定义主机需要调用那些模块完成功能 ③core modeules核心模块主要操作通过调用核心模块来完成管理任务 ④customodules自定义模块完成核心模块无法完成的模块支持多种语言编写 ⑤connectiontugins连接插件ansible和主机通信使用(ssh协议) 6工作原理及流程 ①加载自己的配置文件默认/etc/ansible/ansible.cfg ②查找对应的主机的配置文件找到要执行的主机或组/etc/ansible/hosts文件 ③加载自己对应的模块文件如command、yum、ping、 ④通过ansible将模块命令生成对应的临时py文件(类似python脚本)并将该文件传输至被管理端 ⑤传输到在被控制端的对应用户的家目录下.ansible/tmp/xxx/xxx.py ⑥被控制端给传输过来的py文件加执行权限 ⑦执行并返回结果执行完成后删除py文件并sleep 0退出 2.部署Ansible自动化运维工具 环境 表1 主机 管理端192.168.111.199ansible被管理端192.168.111.69被管理端192.168.111.186被管理端192.168.111.100 1部署 yum install -y epel-release #安装epel-release yum install -y ansible #安装ansible #配置文件位置:/etc/ansible/ansible #hosts文件位置:/etc/ansible/hosts vim /etc/ansible/hosts #编辑hosts文件添加被管理的机器内容如下[webservers] #配置组名 192.168.204.69 #组里包含的被管理的主机IP地址或主机名主机名需要先修改/etc/hosts文件[dbservers] 192.168.204.186 #[webservers]、[dbservers]各为一个组组内1个服务器添加完毕保存退出 配置密钥对验证#使用ssh免交互需要下载sshpass工具参考sshpass免密登录 ssh-keygen -t rsa #一路回车使用免密登录(配置密钥对验证) sshpass -p 123123 ssh-copy-id root192.168.204.69 sshpass -p 123123 ssh-copy-id root192.168.204.186 或者直接输入ssh-copy-id root192.168.204.69 #上传公钥到被控制端 ssh-copy-id root192.168.204.185#进入生成的公钥路径将公钥传输给备管理的服务器传输需要输入每台备管理服务的root密码ansible ansible-doc -l #安装完毕此命令可以查看有哪些ansible模块按q退出ansible webservers -m command -a pwd #安装完成尝试管理webservers组输入pwd命令 ansible all -a ls #安装完成尝试管理所有hosts中主机输入ls命令不指定模块默认为command模块 ansible 192.168.204.69 -m -a ls #安装完成尝试管理192.168.204.69服务器输入pwd命令 3.Ansible常用模块 (1) ansible命令行模块 命令格式ansible 组名/ip -m 模块 -a参数列表 ansible-doc -s 模块 #-s 列出指定模块的描述信息和操作动作 ansible-doc -s command [rootansible ansible]# ansible-doc -s command - name: Execute commands on targetscommand:argv: # Passes the command as a list rather than a string. Use argv to avoid quoting values that would otherwise be interpretedincorrectly (for example user name). Only the string or the list form can be provided, not both.One or the other must be provided.chdir: # Change into this directory before running the command.cmd: # The command to run.creates: # A filename or (since 2.0) glob pattern. If it already exists, this step *wont* be run.free_form: # The command module takes a free form command to run. There is no actual parameter named free form.removes: # A filename or (since 2.0) glob pattern. If it already exists, this step *will* be run.stdin: # Set the stdin of the command directly to the specified value.stdin_add_newline: # If set to yes, append a newline to stdin data.strip_empty_ends: # Strip empty lines from the end of stdout/stderr in result.warn: # Enable or disable task warnings.(2) command模块 此模块不能使用管道符和重定向指定模块默认为commend模块 举例ansible  webservers   -m   command   -a  date 调用command模块在192.168.204.69服务器上执行ls命令若不指定则默认为command模块 #指定 ip 执行 date ansible 192.168.204.69 -m command -a date#指定组执行 date ansible webservers -m command -a date ansible dbservers -m command -a date #all 代表所有 hosts 主机 ansible all -m command -a date #如省略 -m 模块则默认运行 command 模块 ansible all -a ls / 常用的参数 表2  command常用参数 chdir在远程主机上运行命令前提前进入目录creates判断指定文件是否存在如果存在不执行后面的操作removes判断指定文件是否存在如果存在执行后面的操作 ansible all -m command -a chdir/home ls ./(3) shell模块 用远程主机的shell进程打开一个子shell进行命令操作支持管道符和重定向。 在远程主机执行命令相当于调用远程主机的shell进程然后在该shell下打开一个子shell运行命令支持管道符号等功能。 举例ansible webservers -m shell -a ifconfig ens33 |awk NR2{print \$2} 提取webservers组中的所有ip地址注意双引号不识别变量所以要加转义符\ 列出指定模块的描述信息和操作动作 ansible-doc -s shell首先在192.168.204.186服务器上创建一个用户 [rootlocalhost ~]# useradd test使用shell给dbservers组中的服务器中的用户设置密码 ansible dbservers -m shell -a echo 666666 | passwd --stdin test截取dbservers组中主机的ip ansible dbservers -m shell -a echo $(ifconfig ens33 | awk NR2 {print $2}) | cut -d -f2ansible dbservers -m shell -a echo $(ifconfig ens33 | awk NR2 {print \$2}) 4cron模块 远程主机定义计划任务2种状态present(添加)和absent(移除)默认为present。 举例ansible  webservers -m cron  -a namecrontest hour*/12  day*/1 job/usr/bin/echo   cron test     ansible webservers -m cron -a namecrontest  stateabsent 列出指定模块的描述信息和操作动作 #按 q 退出 ansible-doc -s cron 常用的参数 表3 cron常用参数 minute/hour/day/month/weekday分/时/日/月/周job任务计划要执行的命令name任务计划的名称 #每年 10 月 21 日 每2个小时的10 30 50分执行一次输出helloworld的操作名字就叫做test cron ansible webservers -m cron -a minute*10,30,50 hour*/2 day21 month10 job/bin/echo helloworld nametest cron#查看计划任务 ansible webservers -a crontab -l #移除计划任务假如该计划任务没有取名字nameNone即可 ansible webservers -m cron -a nametest cron stateabsent 5 user模块 用户管理模块 举例ansible webservers -m user -a namecrontest  uid10086  grouproot ansible webservers -m user -a namecrontest    stateabsent  removeyes 列出指定模块的描述信息和操作动作 #按 q 退出 ansible-doc -s user 常用的参数 表4 user常用参数 name用户名必选参数statepresent|absent创建账号或者删除账号present表示创建absent表示删除systemyes|no是否为系统账号uid用户uidgroup用户基本组shell默认使用的shellmove_homeyse|no如果设置的家目录已经存在是否将已经存在的家目录进行移动password用户的密码建议使用加密后的字符串comment用户的注释信息removeyes|no当stateabsent时是否删除用户的家目录 #创建用户test0 ansible dbservers -m user -a nametest0 ansible dbservers -m command -a tail /etc/passwd#删除用户test0 ansible dbservers -m user -a nametest0 stateabsent (6) group模块   用户组模块 常用参数 name:组名称 gid组id system是否为系统组 列举指定模块的描述信息和操作动作 ansible-doc -s group#创建mysql组 ansible dbservers -m group -a namemysql gid306 systemyes ansible dbservers -a tail /etc/group#创建用户test01 ansible dbservers -m user -a nametest01 #将test01用户添加到mysql组中 ansible dbservers -m user -a nametest01 uid306 systemyes groupmysql ansible dbservers -a tail /etc/passwd ansible dbservers -a id test01 (7) copy模块  复制文件或输出内容到被控制服务器上 举例       ansible webservers -m copy   -a src/a.txt  dest/opt/ ansible webservers -m copy   -a content123456  dest/opt/a.txt 列举指定模块的描述信息和操作动作 ansible-doc -s copy常用的参数 表5 copy常用参数 dest指出复制文件的目标及位置使用绝对路径如果是源目录指目标也要是目录如果目标文件已经存在会覆盖原有的内容src指出源文件的路径可以使用相对路径或绝对路径支持直接指定目录如果源是目录则目标也要是目录mode指出复制时目标文件的权限owner指出复制时目标文件的属主group指出复制时目标文件的属组content指出复制到目标主机上的内容不能与src一起使用 ansible dbservers -m copy -a src/etc/fstab dest/opt/fstab.bak ownerroot mode640 ansible dbservers -a ls -l /opt ansible dbservers -a cat /opt/fstab.bak#将helloworld写入/opt/hello.txt文件中 ansible dbservers -m copy -a contenthelloworld dest/opt/hello.txt ansible dbservers -a cat /opt/hello.txt (8) file模块 文件属性管理模块 常用参数owner文件的属主group文件属组mode文件权限path文件路径 指定的属主和属组不存在会报错 举例ansible  webservers  -m  file  -a  owerlhj grouplhj mode777 path/opt/a.txt     列举指定模块的描述信息和操作动作 ansible-doc -s file#修改文件的属主属组权限等 ansible dbservers -m file -a ownertest01 groupmysql mode644 path/opt/fstab.bak #设置/opt/fstab.link为/opt/fstab.bak的链接文件 ansible dbservers -m file -a path/opt/fstab.link src/opt/fstab.bak statelink #创建一个文件 ansible dbservers -m file -a path/opt/abc.txt statetouch#删除一个文件 ansible dbservers -m file -a path/opt/abc.txt stateabsent 9hostname模块 修改被控制端的主机名 参数name指定被控端的主机名  举例ansible  webservers -m hostname -a nameansible 列举指定模块的描述信息和操作动作 ansible-doc -s hostname修改主机名 #将dbservers中服务器得主机名修改为mysql01 ansible dbservers -m hostname -a namemysql01#回到dbservers服务器中查看 su(10) ping模块 检测ansible与被控端的网络连通性 举例ansible  webservers  -m ping  列举指定模块的描述信息和操作动作 ansible-doc -s ping#检测远程主机得连通性 ansible all -m ping#指定ip检测 ansible 192.168.204.186 -m ping (11)yum模块 在远程主机上yum安装与卸载软件包 常用参数name指定要安装卸载的软件statepresent/absent默认persent添加absent卸载 举例ansible   webservers  -m  yum  -a  namehttpd   列举指定模块的描述信息和操作动作 ansible-doc -s yum#dsbsrvers检测是否安装httpd systemctl status httpdUnit httpd.service could not be found.#ansible给dsbsrvers安装服务 ansible dbservers -m yum -a namehttpd#dsbsrvers检测httpd状态 systemctl status httpd● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)Active: inactive (dead)Docs: man:httpd(8)man:apachectl(8)#ansible给dsbsrvers卸载服务 ansible dbservers -m yum -a namehttpd stateabsent #dsbsrvers检测httpd状态 systemctl status httpdUnit httpd.service could not be found. (12)service/system模块 管理远程被控制主机上的管理服务的运行状态 举例ansible webservers -m service -a enabledyes  namehttpd statestarted 列举指定模块的描述信息和操作动作 ansible-doc -s service常用的参数 表6 service/system常用参数 name被管理的服务名称statestarted|stopped|restarted动作包含启动关闭或者重启enabledyes|no表示是否设置该服务开机自启runlevel如果设定了enabled开机自启去则要定义在哪些运行目标下自启动 # 给webservers安装httpd服务 ansible webservers -m yum -a namehttpd#查看web服务器httpd运行状态 ansible webservers -a systemctl status httpd 192.168.204.69 | FAILED | rc3 ● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)Active: inactive (dead)Docs: man:httpd(8)man:apachectl(8)non-zero return code#启动httpd服务 ansible webservers -m service -a enabledtrue namehttpd statestarted #查看web服务器httpd运行状态 ansible webservers -a systemctl status httpd 192.168.204.69 | CHANGED | rc0 ● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)Active: active (running) since 一 2023-08-28 14:55:51 CST; 5s agoDocs: man:httpd(8)man:apachectl(8)Main PID: 5304 (httpd)Status: Processing requests...CGroup: /system.slice/httpd.service├─5304 /usr/sbin/httpd -DFOREGROUND├─5307 /usr/sbin/httpd -DFOREGROUND├─5308 /usr/sbin/httpd -DFOREGROUND├─5309 /usr/sbin/httpd -DFOREGROUND├─5310 /usr/sbin/httpd -DFOREGROUND└─5311 /usr/sbin/httpd -DFOREGROUND (13)script模块  实现远程批量运行本地的shell脚本 列举指定模块的描述信息和操作动作 ansible-doc -s script在本地编写一个脚本 ansible服务器 vim /test.sh #编写/下的test.sh脚本内容如下 #!/bin/bash echo hello ansible from script /opt/script.txtchmod x test.sh ansible webservers -m script -a test.sh ansible webservers -a cat /opt/script.txt (14)setup模块 setup 模块可以获取这些信息 facts 组件收集d 被管理节点信息 参数filter 过滤可配合正则表达式。 ansible webservers -m setup -a filter*ipv4 列举指定模块的描述信息和操作动作 ansible-doc -s setup#获取mysql组主机的facts信息 ansible webservers -m setup #使用filter可以筛选指定的facts信息 ansible dbservers -m setup -a filter*ipv4 4.hostsinverntory主机清单 hosts配置文件位置/etc/ansible/hosts Inventory支持对主机进行分组每个组内可以定义多个主机每个主机都可以定义在任何一个或多个主机组内 如果是名称类似的主机可以使用列表的方式标识各个主机。 vim /etc/ansible/hosts [webservers] 192.168.204.186:2222 #冒号后定义远程连接端口默认是 ssh 的 22 端口 192.168.204.18[5:7][dbservers] db-[a:f].example.org #支持匹配 a~f (1)inventory 中的变量含义 Inventory变量名含义ansible_hostansible连接节点时的IP地址ansible_port连接对方的端口号ssh连接时默认为22ansible_user连接对方主机时使用的主机名。不指定时将使用执行ansible或ansible-playbook命令的用户ansible_password连接时的用户的ssh密码仅在未使用密钥对验证的情况下有效ansible_ssh_private_key_file指定密钥认证ssh连接时的私钥文件ansible_ssh_common_args提供给ssh、sftp、scp命令的额外参数ansible_become允许进行权限提升ansible_become_method指定提升权限的方式例如可使用sudo/su/runas等方式ansible_become_user提升为哪个用户的权限默认提升为rootansible_become_password提升为指定用户权限时的密码 (2)主机变量使用 写法1 #webservers组中被控制端192.168.204.69的端口号为22登录时用户是root密码为123123[webservers] 192.168.204.69 ansible_port22 ansible_userroot ansible_password123123 192.168.204.186 ansible_port22 ansible_userroot ansible_password123123写法2 #如果是名称类似的主机可以使用列表的方式标识各个主机[webservers] 192.168.204.6[8:9] ansible_port22 ansible_userroot ansible_passwordabc123写法3 #默认ssh管理时的端口为22若不是22则直接在被管理ip后加冒号和对应端口号[webservers] 192.168.204.69:22 192.168.204.186:22添加一台主机 [webservers] 192.168.204.69 192.168.204.100 ansible_port22 ansible_userroot ansible_password123123[dbservers] 192.168.204.186 查看webservers内得主机ip ansible webservers -m command -a ifconfig(3)组变量使用 #表示为 webservers 组内所有主机定义变量 [webservers:vars] ansible_userroot ansible_password123123#表示为所有组内的所有主机定义变量 [all:vars] ansible_port22 webservers 组内所有主机定义变量 [webservers] 192.168.204.69 192.168.204.100 192.168.204.186#表示webservers 组内所有主机定义变量控制时使用root账户密码为123123 [webservers:vars] ansible_port22 ansible_userroot ansible_password123123 (4)组嵌套使用  ##php组 [php] 192.168.204.100#nginx组 [nginx] 192.168.204.69#httpd组 [httpd] 192.168.204.186#组内嵌为web #表示web组的成员即children的直译‘孩子’包括php、nginx和httpd组 [web:children] php nginx httpd二、实验 1.部署Ansible自动化运维工具 1管理端安装 ansible 完成 如果要查看ansible的目录结构可以安装树形查询工具 添加被管理主机的ip到管理端的配置组名中 配置密钥对验证 使用ssh免交互需要下载sshpass工具 2.ansible 命令行模块 1查看ansible的命令模块 列出所有已安装的模块按q退出 2command 模块 列举指定模块的描述信息和操作动作 指定 ip 执行 date 指定组执行 date 查看所有 hosts 主机 如省略 -m 模块则默认运行 command 模块 查看右几个用户的家目录 3shell 模块 列举指定模块的描述信息和操作动作 首先在192.168.204.186服务器上创建一个用户 使用shell给dbservers组中的服务器中的用户设置密码 截取dbservers组中主机的ip 4cron 模块 列举指定模块的描述信息和操作动作 每年 10 月 21 日 每2个小时的10 30 50分执行一次输出helloworld的操作名字就叫做test cron 查看计划任务 移除计划任务 (5) user 模块 列举指定模块的描述信息和操作动作 创建用户test0 查看用户 删除用户test0 6group 模块 列举指定模块的描述信息和操作动作 创建mysql组 查看组 创建用户test01 将test01用户添加到mysql组中 查看用户 查看用户id和组id 7copy 模块 列举指定模块的描述信息和操作动作 将dbservers组中得/etc/fstab文件复制到 /opt目录中并改名为fstab.bak属主为root权限为640 查看/opt目录中得文件属性 查看是否复制 将helloworld写入/opt/hello.txt文件中 查看文档内容 8file模块 列举指定模块的描述信息和操作动作 修改文件的属主属组权限等 设置/opt/fstab.link为/opt/fstab.bak的链接文件 创建一个文件 删除一个文件 9hostname 模块 列举指定模块的描述信息和操作动作 回到dbservers得服务器查看可以切换名称 (10) ping 模块 列举指定模块的描述信息和操作动作 检测远程主机得连通性 指定ip检测 11yum 模块 列举指定模块的描述信息和操作动作 查看dbservers是否安装httpd服务 ansible给dbservers安装httpd服务 dbservers检测httpd服务 ansible给dbservers卸载服务 dbservers又找不到服务了 12service/systemd 模块 列举指定模块的描述信息和操作动作 给webservers安装httpd服务 查看webservers得httpd状态 启动httpd服务 再次 查看webservers得httpd状态 13script模块  列举指定模块的描述信息和操作动作 在本地编写一个脚本 给程序一个可执行得权限执行程序查看 14setup 模块 列举指定模块的描述信息和操作动作 获取mysql组主机的facts信息 使用filter可以筛选指定的facts信息 3.hostsinverntory主机清单 1主机变量 在ansible配置文件中添加一台新的主机 成功查看ip (2) 组变量 编辑配置文件 为 webservers 组内所有主机定义变量 成功查看 3组嵌套 编辑配置文件 webs主机组包含php、nginx和httpd组 成功查看 三、问题 1. ansible远程shell失败 1报错 2原因分析 replace过滤器中的一个逃逸问题。您需要替换双引号该双引号将字符串转换为\。由于该字符串本身位于双引号字符串内因此必须转义 \\\n 3解决方法 去掉多余的双引号 2.组变量查看webservers内主机ip报错 1报错 2原因分析 从输出提示上基本可以了解到由于在本机的~/.ssh/known_hosts文件中并有fingerprint key串ssh第一次连接的时候一般会提示输入yes 进行确认为将key字符串加入到 ~/.ssh/known_hosts 文件中 3解决方法 第一种在本地先SSH登录一下对方设备下次ansible 就可以正常操作了但是比较麻烦 第二种设置参数为不检查key vim /etc/ansible/ansible.cfghost_key_checking False #71行取消注释 如继续操作出现如下报错需要修改被管理端/etc/hosts 注释被管理端域名 如继续操作出现如下报错修改 /etc/ansible/hosts 返现密码输入错误 修改前 修改后 成功查看ip 3.组嵌套查看webs内主机ip报错 1报错 2原因分析 组嵌套名称错误 nginx与httpd主机已配置密钥对验证需要对php做密钥对验 #一路回车使用免密登录(配置密钥对验证) ssh-keygen -t rsa [rootansible ansible]# sshpass -p 123123 ssh-copy-id root192.168.204.100 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: /root/.ssh/id_rsa.pub /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keysNumber of key(s) added: 1Now try logging into the machine, with: ssh root192.168.204.100 and check to make sure that only the key(s) you wanted were added. 3解决方法 组嵌套名称web修改为webs 修改配置文件 修改前 修改后 ansible服务器对php做密钥对验 成功查询 四、总结 沟通是DevOps的关键。Ansible是第一款可以在整个IT范围读取和编写的自动化语言。它也是唯能够从头至尾自动化应用生命周期和持续交付管道的自动化引擎。 Ansible用户无需编写复杂的脚本,而只要创建高级别play即可确保主机或主机组处于特定状态。 Play按该play指定的顺序对主机执行一系列任务。这些play通过采用YAML格式的文本文件来表达。包含一个或多个play的文件称为playbook。
http://www.w-s-a.com/news/972040/

相关文章:

  • 做电影网站违法吗莱芜 网站
  • 品牌咨询公司泉州seo不到首页不扣费
  • 做网站做一个什么主题的怎样搭建一个企业网站
  • 做设计的有什么网站桂林论坛网站有哪些
  • 做的网站不能放视频开发公司春联
  • 重庆装修房子可以提取公积金吗长沙优化官网公司
  • 做外贸的网站都有哪些带后台的html网站源码
  • 厦门百度快速优化排名手机系统优化工具
  • 宁波网站制作公司推荐公司建站多少钱
  • 网络营销薪酬公司温州网站优化定制
  • 橙色在网站中的应用淘宝客绑定网站备案号
  • 杭州视频网站建设成都设计院排行
  • 慈溪建设网站盘丝洞app破解无限盘币
  • 关于服装店网站建设的策划方案seo关键词优化软件官网
  • 丰台高端网站建设土巴兔装修贵吗
  • 宽屏网站mysqli pdo wordpress
  • 2022年没封网站直接进入赣州网吧
  • 河南省建设厅证件证件查询网站硬件开发是什么意思
  • tp5做企业网站宿迁房产网租房信息
  • php高级网站开发wordpress不能添加文章
  • 小学校园网站建设付费阅读下载网站开发
  • 如何做招聘网站网站建设中 敬请期待
  • 雅安工程交易建设网站做vip电影网站
  • 网站建设方维网站标题title为什么不能频繁的改
  • 网站建设如何上传文件wordpress列表自定义数据表
  • 摄影课程自学网站科技项目的类型有
  • 未来最紧缺的十大专业长春seo顾问
  • 为什么点不开网站公关公司是做什么的
  • wordpress主要菜单如何对网站页面进行优化
  • 建设银行深分行圳招聘网站建立互联网公司网站