Ansible-Tower使用文档
导航栏介绍
# 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权限
- [xiaoxin@iZ2ze8ow1gy3uiub8glqqzZ ~]$ sudo vim /etc/ansible/ansible.cfg
- host_key_checking = False
创建账号
- [root@iZ2ze8ow1gy3uiub8glqqzZ ~]# useradd xiaoxin
- [root@iZ2ze8ow1gy3uiub8glqqzZ ~]# passwd xiaoxin
- Changing password for user xiaoxin.
- New password:
- Retype new password:
- passwd: all authentication tokens updated successfully.
提权root权限
- [root@iZ2ze8ow1gy3uiub8glqqzZ ~]# visudo
- ## Allow root to run any commands anywhere
- root ALL=(ALL) ALL
- xiaoxin ALL=(ALL) NOPASSWD: ALL
创建密钥
- root@iZ2ze8ow1gy3uiub8glqqzZ ~]# su - xiaoxin
- [xiaoxin@iZ2ze8ow1gy3uiub8glqqzZ ~]$ ll
- total 0
- [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.
私钥认证

上面的是私钥,必须得免密到目标机器
- [xiaoxin@iZ2ze8ow1gy3uiub8glqqzZ ~]$ ssh-copy-id -i /home/xiaoxin/.ssh/id_rsa.pub xiaoxin@10.0.0.94
- /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/xiaoxin/.ssh/id_rsa.pub"
- /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
- /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
- xiaoxin@10.0.0.94's password:
- Number of key(s) added: 1
- Now try logging into the machine, with: "ssh 'xiaoxin@10.0.0.94'"
- 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使用文档的更多相关文章
- k8s ansible部署部署文档
一:基础系统准备 ubuntu 1804----> root密码:123456 主要操作: 1.更改网卡名称为eth0: # vim /etc/default/grub GRUB_CMDLI ...
- 【Ansible 文档】【译文】Playbooks 变量
Variables 变量 自动化的存在使得重复的做事情变得很容易,但是我们的系统不可能完全一样. 在某些系统中,你可能想要设置一些与其他系统不一样的行为和配置. 同样地,远程系统的行为和状态也可以影响 ...
- 【Ansible 文档】【译文】Ad-Hoc 命令介绍
Introduction To Ad-Hoc Commands Ad-Hoc命令介绍 下面的例子展示了如何使用 /usr/bin/ansible 来运行ad hoc任务. 什么是ad hoc命令? 一 ...
- 【Ansible 文档】【译文】入门教程
http://docs.ansible.com/ansible/latest/intro_getting_started.html Foreword 前言 到这里,你应该已经安装了Ansible,是时 ...
- 【Ansible 文档】【译文】常见问题
http://docs.ansible.com/ansible/latest/faq.html 如何为一个task或者整个Playbook设置PATH或者任意其他环境变量? 通过environment ...
- 【Ansible 文档】【译文】网络支持
Networking Support 网络支持 Working with Networking Devices 使用网络设备 自从Ansible 2.1开始,你现在可以使用成熟模型 - 编写 play ...
- 【Ansible 文档】【译文】Windows 支持
see also:List of Windows Modules Windows Support Windows 支持 Windows: How Does It Work Windows:如何工作 正 ...
- 【Ansible 文档】【译文】配置文件
这里说明一下配置文件的内容,原文地址:http://docs.ansible.com/ansible/latest/intro_configuration.html 这个与[Ansible 文档]配置 ...
- 【Ansible 文档】【译文】动态inventory
Dynamic Inventory 动态inventory 配置管理系统的用户经常想要保存inventory到不同的软件系统中.Ansible提供了一个基本的基于文本的系统,正如inventory中描 ...
- Ansible 如何查看模块文档
[root@localhost ~]$ ansible-doc -l # 列出所有模块 [root@localhost ~]$ ansible-doc cron # 查看指定模块的文档
随机推荐
- Codeforces_712_A
http://codeforces.com/contest/712/problem/A 水题,写出来就看到规律了. #include<iostream> #include<cstri ...
- Head First设计模式分析学习
永不放弃的毅力,和对欲望的控制. 注意:要能够理解相类似的设计模式之间的区别和不同.可以把类比列举出来,加深记忆. 是否加入Spring容器中的标准是是否要用到Spring框架的方法或者功能特性,如事 ...
- 微信小程序中的图表构建
第一 html中的代码 <view class="container"> <canvas canvas-id="lineCanvas" bin ...
- 构建ROP链实现远程栈溢出
通常情况下栈溢出可能造成的后果有两种,一类是本地提权另一类则是远程执行任意命令,通常C/C++并没有提供智能化检查用户输入是否合法的功能,同时程序编写人员在编写代码时也很难始终检查栈是否会发生溢出,这 ...
- Hexo搭建静态博客踩坑日记(一)
前言 博客折腾一次就好, 找一个适合自己的博客平台, 专注于内容进行提升. 方式一: 自己买服务器, 域名, 写前端, 后端(前后分离最折腾, 不分离还好一点)... 方式二: 利用Hexo, Hug ...
- python 解压、复制、删除 文件
一.python3解压文件 1.python 解压文件代码示例 如下代码主要实现zip.rar.tar.tar.gz四种格式的压缩文件的解压 def unzip_file(src_file, dst_ ...
- 数组翻转(非reverse)
var arr = [1,2,3,4]; var arr2 = []; while(arr.length) { var num = arr.pop(); //删除数组最后一个元素并返回被删除的元素 a ...
- 通过HTML和CSS1:1还原风暴英雄官方网站
<!--HTML代码--> <!DOCTYPE html> <html lang="en"> <head> <meta cha ...
- mybatis postgresql 批量删除
一.需求介绍 前端是一个列表页面,列表可以进行复选框的选择,后台进行关联表数据的删除. 二.框架介绍 springboot+mybatis 数据库用的postgresql 三.具体代码(前端js) 1 ...
- MATLAB中冒号的用法解析
MATLAB中冒号的用法解析 1.: 表示所有的意思. (1)如:a(1,:) 表示a的第1行,示例: 结果: 同样的如果a(2,:)表示a的第2行 (2)反过来,a(:,2) 表示a的第3列,示例: ...