腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
不能在文件之间传递变量
ansible
、
ansible-template
我试图
使用
Ansible
将一些jinja2模板放到目录中,例如path/from/*.j2 to path/to/*.txt。--- include: copy-files.yml - test_var loop_control=> {"failed": true, "msg": &qu
浏览 0
提问于2019-02-06
得票数 0
回答已采纳
1
回答
使用
with_nested
和
Ansible
ansible
、
f5
(即VS1:rule1,VS2:rule2,依此类推,如下所示) 下面是'Virtual_Check‘
和
’Rule_Check‘在stdout_lines中存储的内容: "Virtual_Check.stdout_lines当我运行这本剧本时,'
with_nested
‘下的'Virtual_Check’部分会像预期的那样循环,但我遇到的问题是'Rule_Check‘部分不能正确地循环(我在下面尝试了两个方法) 到目前为止,我已经尝试
使用
with_nested
来完成
浏览 55
提问于2019-07-02
得票数 2
1
回答
Ansible
:检查有
和
没有结果的多个作业的async_status
ansible
其中两个是
使用
循环创建的,因此,它们具有键results
和
对象返回列表,其中一个只返回一个具有键
ansible
_job_id的对象。 'list对象‘没有属性'
ansible
_job_id’ async_status: jid: "{{ item.
ansible
_job_id }}&
浏览 3
提问于2022-05-30
得票数 1
回答已采纳
1
回答
如何利用
with_nested
对2条数据进行解析得到价值?
loops
、
dictionary
、
ansible
我有以下两个地图设置 eu_: "blue" sweden: "light"我想用
ansible
中的
with_nested
用相同的方式循环两个映射,但是我需要访问两个dicts的键
和
值。debug: msg: "key: {{ item[0].key + item[1].key }}, value: {{ item
浏览 4
提问于2017-10-27
得票数 1
回答已采纳
1
回答
将with_fileglob与
Ansible
剧本中的另一个列表结合起来
ansible
所以我有一个
Ansible
剧本,我试图为列表中的每一项调用一个命令,但也在一个文件库上运行该命令。
Ansible
中有一个"
with_nested
“,它可以
使用
变量名,但是如果我添加一个"with_fileglob”,它只是插入"with_fileglob“作为文件名,而不是实际执行一个glob。- command: reprepro -b /var/www/html includedeb {{ item[0].version }} {{ item[1] }}
浏览 0
提问于2014-07-30
得票数 0
回答已采纳
2
回答
可能-同时
使用
with_items
和
with_sequence
loops
、
sequence
、
roles
、
ansible
}' | awk -F'country=' '{print $2}' | cut -d'&' -f1); printf ' ';{{ item }} | cut -d ' ' -f-2) >> {{
ansible
_env.DATA_LOG
浏览 0
提问于2015-07-01
得票数 2
2
回答
可扩展的循环
和
子字典
ansible
我正在尝试
使用
jinja模板
和
yaml变量文件遍历
Ansible
中的一些参数。jinja模板的内容在这里并不重要,但是我可以在下面分享一个版本的攻略
和
yaml变量文件。我尝试过
with_nested
和
with_subelements -subelement似乎只想
使用
列表,而不是字典,而且我找不到一种方法来
使用
with_nested
列出对等体中的值。template: d
浏览 0
提问于2020-11-24
得票数 0
3
回答
在
ansible
.builtin.shell时在loop_control标签中
使用
增量
ansible
我有如下简单的
ansible
脚本。我想知道我们是否可以在loop_control中
使用
ansible
.builtin.shell的delta - hosts: localhost tasks:
with_nested
: - ['700', '600
浏览 122
提问于2021-05-06
得票数 0
1
回答
如何在
Ansible
中嵌套with_filetree?
ansible
我
使用
Ansible
为各种应用程序(基于group_names)推送配置文件&需要从列表变量循环通过配置.j2模板。如果我
使用
已知的配置模板列表,我可以
使用
这样的标准
with_nested
. src: '{{ playbook_dir }}/templates/{{ item[1] }}/configs/{{ item[0] }}.j2' dest: /path/to/{{ it
浏览 2
提问于2020-09-29
得票数 1
回答已采纳
1
回答
Ansible
嵌套循环尝试仅迭代"all“、"ungrouped”值
ansible
我尝试创建一个
Ansible
角色,它将四行添加到两个文件中。我想在文件/etc/pam.d/sshd
和
login中添加A、B、C
和
D行。path: "/etc/pam.d/{{ item.0.name }}" line: "{{ item.1 }}"
with_nested
paths运行良好,行被添加到正确的文件中,但
Ansible</e
浏览 1
提问于2017-11-17
得票数 1
1
回答
可变长列表作为变量动态列表
ansible
带
ansible
的新手我想先把这个保持为8 username: "{{ username }}"
with_neste
浏览 0
提问于2020-11-09
得票数 0
回答已采纳
2
回答
Ansible
:为"with_items“中包含的每一项增加一个变量
ansible
- set_fact: counter : {{ number | int + 1 }} value2 : {{ item.
ansible
_facts.summary.quickStats.overallMemoryUsage }} value3我也试着玩"with_sequence“或"
with_nested
浏览 3
提问于2021-04-16
得票数 0
2
回答
是否可以
使用
Ansible
Playbook将with_dict
和
with_nested
循环在一起?
ansible
、
ansible-playbook
我尝试循环遍历一个散列
和
与其关联的数组,如下所示: dictionary: bword: [ fat, slim ]name: Create symlinks
with_nested
: - "{{ item.key }}"或者
Ansible
不支持这样的迭代?
浏览 2
提问于2016-02-02
得票数 7
回答已采纳
1
回答
在一个任务中
使用
两个with_items循环
ansible
我对这个问题做了相当多的研究。虽然我没有找到解决我的问题的答案。 我想通过删除目录本身来删除目录的内容。我想对多个目录执行此操作。 从理论上讲,我想做这样的事情: - name: Delete dir on Prod/Stag state: "{{ item.1 }}" with_items.1: - directory - test1 - test3
浏览 9
提问于2019-04-18
得票数 1
1
回答
循环遍历字典,其中键的值再次是
ansible
中的列表
ansible
判决书如下- "user1": ['abc'],} 我想在
ansible
中迭代这个dict及其值。亲切地建议我尝试了with_items
和
with_nested
,但没有按正确的顺序迭代(当键是user1时,值应该是abc,但我得到的是单声道,有时是lolo随机)
浏览 1
提问于2021-07-14
得票数 0
2
回答
将可能的字典列表值转换为键,将键转换为值
ansible
、
ansible-2.x
、
ansible-inventory
、
ansible-facts
、
ansible-template
我有一个场景,我需要在
Ansible
playbook中将这个字典dict1转换为dict2,如下所示 dict1 = {'a':[1,2,3],'b':[4,5,6]} dict2 = {1: 'a', 2: 'a', 3: 'a', 4: 'b', 5: 'b', 6: 'b'} 我尝试过
with_nested
,with_items,但都不能正常工作。
浏览 58
提问于2021-07-23
得票数 0
回答已采纳
1
回答
如何在
ansible
中同时
使用
循环
和
with_nested
ansible
、
nested-loops
- key1: value2 - value2.1 debug: msg: "This is key1:
浏览 29
提问于2019-05-18
得票数 1
回答已采纳
1
回答
该任务包括一个带有未定义变量的选项。
loops
、
variables
、
ansible
、
centos7
、
firewalld
我有下面的vars文件
和
Ansible
任务,它允许防火墙上的特定源IP的一些端口。FAILED!尽管我能够
使用
debug
Ansible
模块回显这些变量,所以基本上我无法在这个任务中具体
使用
这些变量。permanent: yes state: enabled source: "{{ item.1 }}"
浏览 0
提问于2019-09-16
得票数 2
回答已采纳
1
回答
不可复制的文件以及从两个列表中获取文件的源
和
目的地名称
ansible
、
ansible-2.x
、
ansible-facts
、
ansible-template
我必须复制
和
重命名多个文件在这里,sources_files列表: - /path1/sourceFileOne.txt/path1/destFileOne.txt -> /path1/sourceFileOne.txt- name: Rename or copy sourcesand paths remote_sr
浏览 1
提问于2021-07-01
得票数 0
回答已采纳
1
回答
如何在剧本中获得嵌套循环的等价性?
ansible
、/foo5 这是合理的可能吗?如果是的话,我该怎么做?
浏览 2
提问于2021-02-11
得票数 1
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Ansible 介绍和使用
使用Ansible管理OpenStack
Ansible role使用入门
使用 ARA 分析 Ansible 运行
使用 Vagrant 测试 Ansible 剧本
热门
标签
更多标签
云服务器
ICP备案
实时音视频
对象存储
云直播
活动推荐
运营活动
广告
关闭
领券