腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
2
回答
可能
获取
清单
中
定义的
主机
名
ansible
、
hostname
、
ansible-inventory
在我的
清单
中
,我这样定义
主机
: 141.151.176.223 我正在寻找一个保存server1名称的变量,因为我正在使用它来定义服务器
主机
名。inventory_hostname设置为141.151.176.223
ansible
_hostname,inventory_hostname_short设置为148。
浏览 2
提问于2018-01-21
得票数 13
回答已采纳
2
回答
将
列表
作为
清单
传递给
ansible
_runner python模块
python
、
ansible-runner
我想使用
ansible
_runner在
主机
上做一些解析。我有一个
从
数据库收集
主机
列表
的脚本,然后我想将该
列表
传递给
ansible
_runner python模块,而不将“
清单
”写入磁盘。根据我
从
文档
中
可以理解的内容,我尝试这样做:>> hostlist = ['host1', 'host2
浏览 3
提问于2020-06-18
得票数 1
5
回答
如何
从
Ansible
清单
文件
中
获取
主机
列表
?
python
、
ansible
、
ansible-2.x
有没有一种方法可以使用
Ansible
Python API
从
给定的
清单
文件
/组组合
中
获取
主机
列表
?例如,我们的
清单
文件
按服务类型拆分: [dev:children]dev_b my.host.int.abc.com my.host.int.xyz.com[prod:children]prod_b my.host.abc.c
浏览 52
提问于2016-06-04
得票数 20
回答已采纳
1
回答
在jenkins
中
,我的攻略路径是什么?
如何
设置库存有3个相同的选项
amazon-ec2
、
ansible
、
devops
、
ansible-inventory
我已经在我的AWS实例centos上安装了Jenkins和
ansible
,并且正在尝试
从
jenkins调用我的
ansible
攻略?我不知道
如何
设置:我的攻略路径是什么?
如何
设置
清单
有3个选项可供选择( 1.不指定
清单
2.
文件
或
主机
列表
3.内联内容)帮助我,以便我调用
ansible
从
jenkins运行
浏览 0
提问于2017-04-02
得票数 0
3
回答
可能:没有匹配的
主机
ansible
、
ansible-playbook
我正尝试在
Ansible
上执行我的第一个远程shell脚本。我首先生成并复制了SSH密钥。下面是我的yml
文件
:- name:
Ansible
remote shell user: myuser1 become_user: jboss - name: Hello server然而,当启动攻略时,结果是“没有匹配的
主机
浏览 13
提问于2016-07-05
得票数 27
回答已采纳
4
回答
Ansible
:提供的
主机
列表
为空
ansible
、
ansible-playbook
我有以下行动手册,其中远程
主机
是用户输入,随后我尝试收集有关远程
主机
的事实,并将其复制到本地
文件
中
:- hosts: localhost name:add_host: name={{ hostname }} groups=new shell:
ansible
shell: ssh-copy-id -i ~/.ssh/id_rsa user@{{ h
浏览 1
提问于2016-06-17
得票数 17
1
回答
如何
使用
ansible
查找Linux
主机
的序列号
ansible
、
ansible-2.x
、
ansible-facts
因此,我到处寻找Linux服务器序列号的
ansible
“内置”事实,如果没有自定义的dmidecode
ansible
模块,它看起来是不可用的。真的是这样吗?这对我来说似乎很奇怪,有太多的内置的
ansible
事实,序列号没有包括在内。$ /usr/bin/
ansible
--version config file = /home/user/.
ansible
.cfg configured m
浏览 34
提问于2018-02-28
得票数 0
回答已采纳
1
回答
在
Ansible
清单
中
传递变量,并使用
ansible
playbook命令调用
azure-devops
、
ansible
、
ansible-inventory
我有一个
清单
文件
,其中包含以下信息:在tmp目录
中
创建
文件
的可行行动手册:我希望将此Test-server设置为inventory (INI)
文件
中
的变量,如下所示: {{is_host}}
ansible
_host=10.0.0.8
ansible</e
浏览 1
提问于2021-06-16
得票数 0
1
回答
如何
在一个
ansible
模板
中
拥有多个
主机
名?
python
、
ansible
、
drbd
我想生成一个在两台
主机
上相同并包含两个
主机
名的
文件
,例如: on host01 { } device /dev/drbd0; on {{ hostvars[groups['hosts'][1]]['
ansible
_nodename'] }} {device /dev
浏览 3
提问于2016-01-20
得票数 0
3
回答
ansible
中
的系统特定变量
ansible
在我的系统(Arch Linux)上," python“是Python3,所以我必须为每个命令传递-e "
ansible
_python_interpreter=/usr/bin/python2"。
ansible
-playbook my-playbook.yml -e "
ansible
_python_interpreter=/usr/bin/python2" 有没有在我的系统上全局设置
ansible
_python_i
浏览 3
提问于2014-04-01
得票数 30
回答已采纳
2
回答
Ansible
:将变量值合并为新变量
string
、
variables
、
ansible
、
hostvars
假设我有这样的
清单
: hosts:
ansible
_host: 192.168.0.125
ansible
_host: 192.168.0.126
ansible
_host: 192.168.0.127 现在,我将不得不替换
文件
中
的一个字符串,该
文件
具有来自未来的所有
主机
和
主机
的&quo
浏览 8
提问于2022-02-17
得票数 1
回答已采纳
1
回答
获取
攻略
中
的ip地址
列表
ansible
、
yaml
、
jinja2
、
glusterfs
我是
Ansible
的新手,不知道
如何
从
文档
中
实现这一点:我有一个
清单
文件
,如下所示: example_site: ...example_hosts: h1: h2:
ansible
_host: "192.168.0.2" 现在我想
浏览 31
提问于2021-04-20
得票数 0
回答已采纳
1
回答
如何
在
ansible
模板中使用ec2实例的外部IP?
amazon-web-services
、
ansible
、
infrastructure
我正在配置rackspace/digitalocean/aws/google cloud
中
的节点,并且需要在
ansible
的模板
中
访问ec2实例的外部IP。我想在
主机
文件
中
这样定义我的机器:然后在一个模板
中
(类似于iptables的模板): -A FWR -ieth0 -p tcp -s {{
浏览 3
提问于2016-05-28
得票数 2
1
回答
运行
ansible
剧本时缺少
主机
信息
ansible
、
ansible-2.x
我在目录中有一个ansbile.cfg
文件
和一个
主机
文件
。在同一个目录
中
,我有一个test_playbook.yml
文件
。以下是这三份
文件
的副本。当我运行ping (Ad)命令时,我得到了成功的响应。但是,当我尝试运行
ansible
-playbook命令时,响应声明如下: [WARNING]:provided hosts list is empty, only l
浏览 3
提问于2016-07-08
得票数 5
回答已采纳
1
回答
指定了直接
主机
的
Ansible
ad-hoc命令-没有匹配的
主机
linux
、
ansible
、
ansible-2.x
此虚拟机安装了
Ansible
2.4.0。我正在尝试运行一个特别的
ansible
命令,只是为了证明它是有效的(我正在做一个在线课程)。为了模拟一个小型服务器场,我使用了lxc (linux containters),并运行了其中的三个:web2 RUNNING 0 - 10.0.3.226 - 我可以
浏览 0
提问于2017-06-16
得票数 15
回答已采纳
2
回答
单个
文件
中
的可分析事实
ansible
、
ansible-facts
我正在尝试使用以下命令使用
ansible
来收集服务器
清单
:但这会在facts
文件
夹下为每个
主机
生成大量的单个
文件
。我希望所有的服务器输出在一个唯一的
文件
,我注意到内容类似于json。稍后我想用它来读入python,并使用
主机
名作为python字典的关键字,然后只读取有关收集到的每个
主机
的事实。
ansible
localhost -
浏览 1
提问于2020-07-22
得票数 1
1
回答
如何
在变量
中
获取
主机
别名?
ansible
、
ansible-inventory
、
ansible-facts
在
ansible
脚本
中
,我们有一个变量 set_fact: Obj_prefix=smoke-{{
ansible
_host }} 这个事实和我们的
ansible
主机
名一样长,就像machinename.labname.domainname在我们的
清单
文件
中
,我捕获了
主机
名为 [swarmcluster] smaster
ansible
_host=swarmmaster.vlab.mycompany.com 如果我可
浏览 15
提问于2019-04-16
得票数 0
回答已采纳
3
回答
在
Ansible
中
为所有
主机
定义默认变量的正确方法
ansible
、
ansible-inventory
我的
ansible
清单
文件
中有一个[all:vars]的定义,如下所示:
ansible
_shell_type=bash
ansible
_ssh_common_args="-o ConnectionAttempts=10" 我计划将这些变量移到
ansible
.cfg
中
,为所有
主机
设置默认值。还有什么替代方法可以
从
清单
浏览 0
提问于2017-09-13
得票数 12
回答已采纳
1
回答
如何
为亚马逊ec2
主机
格式化一个简单的
Ansible
清单
文件
?
ansible
我无法运行示例即席命令:
ansible
-m ping hosts --private-key=~/home/ec2-user/ -u ec2-user 错误是: [WARNING]: Couldnot match supplied host pattern, ignoring: hosts [WARNING]: No hosts matched, nothing to do
主机
名为:ip-10-200-2-21.us-west-2.computer 我可以通过这个
主机
名
从
我的
an
浏览 17
提问于2019-03-14
得票数 0
回答已采纳
1
回答
Ansible
- host_list拒绝解析/etc/
ansible
/hosts,因为它没有传递它的verify_file()方法
ansible
我的本地/etc/
ansible
/hosts
文件
刚刚有 [example] config file = /etc/
ansible
/
ansible
.cfg configured module search path = [u'/home/michael/.
ansible
/plugins&
浏览 146
提问于2019-06-06
得票数 18
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
ansible基础 ad-hoc命令
ansible系列第五篇
playbook剧本中的模板与setup变量
Ansible 系列(一)
Ansible 进阶 动态 Inventory
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券