2019-04-26 Day 40







GET 浏览网页的过程是GET方法

POST将客户端数据提交到服务器,例:注册用户

HEAD 看网页首部

DELETE

HTTP状态码


查看响应头


网页跳转













上节内容回顾加实践

41是管理机:

41----->61

41----->31

1)在41上配置ansible

#!/bin/bash

yum install ansible -y

ssh-keygen -f ~/.ssh/id_rsa  -P '' -q

for ip in 31 61

do

  sshpass -p123456 ssh-copy-id -f -i ~/.ssh/id_rsa.pub "-o StrictHostKeyChecking=no" 172.16.1.$ip

done

#test

ssh 172.16.1.61 "ifconfig eth0"

ssh 172.16.1.31 "ifconfig eth0"

2)ansible基本配置

[root@backup ~]# cat /etc/ansible/hosts

[oldboy]

172.16.1.31

172.16.1.61

vim /etc/ansible/ansible.cfg +374

结尾增加: -o StrictHostKeyChecking=no

ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s  -o StrictHostKeyChecking=no

3)使用ansible

[root@backup ~]# ansible oldboy -m command -a "free -m"

172.16.1.31 | CHANGED | rc=0 >>

              total        used        free      shared  buff/cache  available

Mem:            972          79        791          7        101        757

Swap:          767          0        767

172.16.1.61 | CHANGED | rc=0 >>

              total        used        free      shared  buff/cache  available

Mem:            972          66        768          7        137        754

Swap:          767          0        767

4)查看使用帮助

ansible-doc -l    #模块就Linux命令了。

command    Executes a command on a remote node

查模块的参数:

ansible-doc -s command  #Linux命令参数

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1.ssh-keygen非交互式创建秘钥对: 具体命令:ssh-keygen -f ~/.ssh/id_rsa -...
    一关_e438阅读 399评论 0 0
  • 1,ansible介绍 ssh密钥认证+脚本批量管理,特点:简单,实用 但是看起来比较low,需要人工写脚本,类似...
    自律的生活无虑阅读 305评论 0 0
  • 96.你是老板你会怎么选择员工?人品、态度、能力、价值==============================...
    苦丿咖啡阅读 604评论 0 0
  • 1.ansible介绍 ssh秘钥认证+脚本批量管理,特点:简单、实用, 但是看起来比较LOW,需要人工写脚本,类...
    木木彡_ebe8阅读 297评论 0 0
  • 生命便是在努力完善自己中活着完善自己的生活完善自己的事业同时不断写作让完善自己与不断写作去做最好的兄弟 此生手足情...
    状元大人阅读 274评论 1 4