惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

Ansible

一个 tui 的 ansible playbook 执行引擎,欢迎使用 - V2EX 分享自己写的一个 ansible role,用来部署 meilisearch 有人同时用 PVE 和 Ansible 吗,用 Ansible 来管理 PVE 上的应用还挺方便 关于《大教堂与集市中》2.12 节的疑问 有时候 bug 出现的目标环境是其他发行版本,用 vagrant 还是 docker 来虚拟环境比较好? - V2EX yum install -y docker-ce-18.09.9-3.el7 还让我确认?怎么规避这个确认 - V2EX ansible sudo su - 不支持 - V2EX 关于 AWX 执行 ansible 的原理不解的地方 ansible-playbook 的剧本和相关的二进制文件怎么存比较好? - V2EX ansible 远程自动交互式命令的响应 - V2EX jenkins 和 ansible 在不同服务器,想在 jenkins 配置远程 ansible 来调用对应 playbook 和 hosts 可以吗? - V2EX ansible api 里面的 ad-hoc 和 playbook 怎么做异步 - V2EX ansible 有没有关于 passphrase 的配置的 - V2EX Python 如何将 txt 导入 excel? - V2EX 刚刚在抢 S7 鸟巢的票,想到一个问题,之前大麦网说被 80W 并发量挤爆了 - V2EX Ansible 节点边栏链接错误 - V2EX ansible 中的 check 模式和 diff 模式到底神马意思? - V2EX ansible su 切换用户问题? - V2EX 请假 ansible 里 template 模板是否支持目录呢 - V2EX ansible 如何控制 windows 后台运行 nginx? - V2EX 玩 Ansible 虐到自己了! - V2EX Ansible Container Ansible 使用 Dynamic inventory 的 Script 得到的所有主机信息有办法分类么? - V2EX Ansible 初学问题 - V2EX ansible 怎么关闭 ask sudo password? - V2EX 发个福利给 Ansible 的同学们,本人亲测有效 - V2EX ansible 不支持 windows 做控制端吗?我的 windows10 py3.4 用这个老是出错 - V2EX ansible 有什么优点么? - V2EX Ansible 官网的文档读起来好别扭 - V2EX Ansible 节点这么冷清? 没有人用吗? - V2EX 用 DigitalOcean 一键部署 Cisco IPSec - V2EX 有了解 ansible-playbook 的么 - V2EX
ansbile 怎么把连接的目标 HOST IP 通过变量传递过去 - V2EX
zealinux · 2020-12-29 · via Ansible

这是一个创建于 1993 天前的主题,其中的信息可能已经有所发展或是发生改变。

比如:ansible-playbook 新建一个任务,

就是把目标 IP 加到目标机器的环境变量中。 主要不知道该怎么传递这个变量。

xcai

1

xcai      2020 年 12 月 29 日

ansible_facts {{ ansible_facts['default_ipv4']['address'] }}如果是机器去取其它机器的 IP 再加上 {{ hostsvars[机器名] ansible_facts['default_ipv4']['address'] }} 具体查一下,不知道有无记错。

David1119

2

David1119      2020 年 12 月 29 日

命令:ansible-playbook xxx.yaml --extra-vars "your_vars=aaaa"

在 xxx.yaml 里面直接用 {{your_vars}}

zealinux

3

zealinux      2020 年 12 月 29 日

@David1119 aaa 是什么?

这个是动态的,是连的那个 host,就是那台 ansible_host

ik

4

ik      2020 年 12 月 29 日

{{ansible_ssh_host}}

ik

5

ik      2020 年 12 月 29 日

```
[root@un~]# ansible all -m debug -a "msg={{ansible_ssh_host}}"
45.153.x.x | SUCCESS => {
"msg": "45.153.x.x"
}
109.166.x.x | SUCCESS => {
"msg": "109.166.x.x"
}
```