导航栏介绍

# viewes
Dashboard 仪表盘展示信息的
Jobs 跑过的任务记录
Schedules 计划任务
My View 查看用户的工作模版,和任务记录
# resources
Templates 任务模版,配置调用playbook执行时的各种参数,从此处添加计划任务
Credentials 配置连接 机器/云主机api Key/自定义的凭证类型 的账号密码等信息
Projects 这里配置项目对应的playbook,可以从Git上拉取或从本地文件夹读取playbook
Inventories 资产清单
Inventory Scripts 自定义获取资产清单的脚本
# access
Organizations 组织管理
Users 用户管理
Teams 用户组管理
# Administration
Credential Types 自定义凭证类型,添加后可在Credentials中使用
Notifications 配置任务通知,支持电子邮件,Twillio电话等
Management Jobs 计划任务管理
Instance Groups 资产组管理
Applications 自定义应用
Settings 设置

打开ssh权限

  1. [xiaoxin@iZ2ze8ow1gy3uiub8glqqzZ ~]$ sudo vim /etc/ansible/ansible.cfg
  2. host_key_checking = False

创建账号

  1. [root@iZ2ze8ow1gy3uiub8glqqzZ ~]# useradd xiaoxin
  2. [root@iZ2ze8ow1gy3uiub8glqqzZ ~]# passwd xiaoxin
  3. Changing password for user xiaoxin.
  4. New password:
  5. Retype new password:
  6. passwd: all authentication tokens updated successfully.

提权root权限

  1. [root@iZ2ze8ow1gy3uiub8glqqzZ ~]# visudo
  2. ## Allow root to run any commands anywhere
  3. root ALL=(ALL) ALL
  4. xiaoxin ALL=(ALL) NOPASSWD: ALL

创建密钥

  1. root@iZ2ze8ow1gy3uiub8glqqzZ ~]# su - xiaoxin
  2. [xiaoxin@iZ2ze8ow1gy3uiub8glqqzZ ~]$ ll
  3. total 0
  4. [xiaoxin@iZ2ze8ow1gy3uiub8glqqzZ ~]$ ssh-keygen -t rsa

创建管理目标服务器的认证方式

Now type credentials ‘NAME‘ and ‘DESCRIPTION‘, then specify the ‘CREDENTIAL TYPE‘ to ‘Machine‘.

Simply, the ‘Machine’ credential will allow you to use the SSH authentication for managing servers. Its support for both password and key-based authentications.

For this guide, we will be using the key-based authentication. So, type the username and paste the private keys for that user.

私钥认证

上面的是私钥,必须得免密到目标机器

  1. [xiaoxin@iZ2ze8ow1gy3uiub8glqqzZ ~]$ ssh-copy-id -i /home/xiaoxin/.ssh/id_rsa.pub xiaoxin@10.0.0.94
  2. /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/xiaoxin/.ssh/id_rsa.pub"
  3. /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  4. /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
  5. xiaoxin@10.0.0.94's password:
  6. Number of key(s) added: 1
  7. Now try logging into the machine, with: "ssh 'xiaoxin@10.0.0.94'"
  8. and check to make sure that only the key(s) you wanted were added.

密码认证

创建Inventories

通过Inventories定义通过Ansible tower管理的主机群组。Inventories允许你为几个服务器创建一个组,并且还能很方便的去管理不同的服务器和它们所依赖的环境变量。为了去管理操作服务器,我们必须去创建一个新的inventory group 并且给这组中添加服务器。
同样,点击ansible tower左侧的菜单Inventories,接着点击右边的+按钮,并选择Inventory:

点击inventory—-输入描述内容

接着点解页面上方的主机(HOSTS)按钮,并点击右侧的+,为这个inventory添加主机,

填写主机名( HOST NAME),描述(DESCRIPTION),并且在VARIABLES中,填入目标主机的IP地址 “ansible_host: 10.0.0.94″,并点击保存(SAVE)。

接着我们在页面下方可以看到我们刚才创建的inventory中新添加的hosts,为了确保host的配置,我们可以通过ping命令来检查该host,选中添加的主机前边的复选框,并且点击RUN COMMANDS按钮。

执行后的结果

Ansible-Tower使用文档的更多相关文章

  1. k8s ansible部署部署文档

    一:基础系统准备 ubuntu 1804----> root密码:123456 主要操作:   1.更改网卡名称为eth0: # vim /etc/default/grub GRUB_CMDLI ...

  2. 【Ansible 文档】【译文】Playbooks 变量

    Variables 变量 自动化的存在使得重复的做事情变得很容易,但是我们的系统不可能完全一样. 在某些系统中,你可能想要设置一些与其他系统不一样的行为和配置. 同样地,远程系统的行为和状态也可以影响 ...

  3. 【Ansible 文档】【译文】Ad-Hoc 命令介绍

    Introduction To Ad-Hoc Commands Ad-Hoc命令介绍 下面的例子展示了如何使用 /usr/bin/ansible 来运行ad hoc任务. 什么是ad hoc命令? 一 ...

  4. 【Ansible 文档】【译文】入门教程

    http://docs.ansible.com/ansible/latest/intro_getting_started.html Foreword 前言 到这里,你应该已经安装了Ansible,是时 ...

  5. 【Ansible 文档】【译文】常见问题

    http://docs.ansible.com/ansible/latest/faq.html 如何为一个task或者整个Playbook设置PATH或者任意其他环境变量? 通过environment ...

  6. 【Ansible 文档】【译文】网络支持

    Networking Support 网络支持 Working with Networking Devices 使用网络设备 自从Ansible 2.1开始,你现在可以使用成熟模型 - 编写 play ...

  7. 【Ansible 文档】【译文】Windows 支持

    see also:List of Windows Modules Windows Support Windows 支持 Windows: How Does It Work Windows:如何工作 正 ...

  8. 【Ansible 文档】【译文】配置文件

    这里说明一下配置文件的内容,原文地址:http://docs.ansible.com/ansible/latest/intro_configuration.html 这个与[Ansible 文档]配置 ...

  9. 【Ansible 文档】【译文】动态inventory

    Dynamic Inventory 动态inventory 配置管理系统的用户经常想要保存inventory到不同的软件系统中.Ansible提供了一个基本的基于文本的系统,正如inventory中描 ...

  10. Ansible 如何查看模块文档

    [root@localhost ~]$ ansible-doc -l # 列出所有模块 [root@localhost ~]$ ansible-doc cron # 查看指定模块的文档

随机推荐

  1. Codeforces 1175F The Number of Subpermutations (思维+rmq)

    题意: 求区间[l, r]是一个1~r-l+1的排列的区间个数 n<=3e5 思路: 如果[l,r]是一个排列,首先这里面的数应该各不相同,然后max(l,r)应该等于r-l+1,这就能唯一确定 ...

  2. Codeforces 1050D Three Religions (dp+序列自动机)

    题意: 给一个1e5的串str,然后有三个起始空串,不超过1000次操作,对三个字符串的一个尾部加一个字符或者减一个字符,保证每个字符不会超过250 每次操作之后询问你这三个串是不是可以组成str的子 ...

  3. 题解 SP375 【QTREE - Query on a tree】

    \[ \texttt{Preface} \] 这题在 \(\text{Luogu}\) 上竟然不能交 \(C++\) ,会一直 \(Waiting\) ,只能交非 \(C++\) 的语言. 所以打完了 ...

  4. 【Bullet引擎】复杂碰撞体 —— btCompoundShape

    说明 API文档:http://bulletphysics.org/Bullet/BulletFull/classbtCompoundShape.html btCompoundShape可用于创建不规 ...

  5. 《Head first设计模式》之外观模式

    外观模式提供了一个统一的接口,用来访问子系统中的一群接口.外观定义了一个高层接口,让子系统更容易使用. 我们已经知道适配器模式是如何将一个类的接口转换成另一个符合客户期望的接口的.现在我们要看一个改变 ...

  6. Apache缓存相关配置

    小编今天来总结下 apache的缓存模块相关信息 硬盘缓存:mod_disk_cache,依赖 mod_cache 模块 内存缓存:mod_mem_cache,依赖 mod_cache 模块 文件缓存 ...

  7. 研发协同平台持续集成之Jenkins实践

    导读 研发协同平台有两个核心目标,一是提高研发效率 ,二是提高研发质量,要实现这两个核心目标,实现持续集成是关键之一. 什么是持续集成 在<持续集成>一书中,对持续集成的定义如下:持续集成 ...

  8. pytorch之 regression

    import torch import torch.nn.functional as F import matplotlib.pyplot as plt # torch.manual_seed(1) ...

  9. git知识简单小结

    git特点: 1)分布式 2)存储快照而非差异 3)本地有完全的版本库,几乎所有操作都在本地 4)有内在的一致性,SHA1 5)优秀的分支管理 6)支持各种协同模式 7)开源,有一些第三方软件可整合使 ...

  10. 微信小程序组件构建UI界面小练手 —— 表单登录注册微信小程序

    通过微信小程序中丰富的表单组件来完成登录界面.手机快速注册界面.企业用户注册界面的微信小程序设计. 将会用到view视图容器组件.button按钮组件.image图片组件.input输入框组件.che ...