Difference between revisions of "With items:"
Jump to navigation
Jump to search
(2 intermediate revisions by one other user not shown) | |||
Line 6: | Line 6: | ||
+ | == Example == | ||
+ | <pre> | ||
+ | <nowiki> | ||
- name: "loop through list" | - name: "loop through list" | ||
− | + | ansible.builtin.debug: | |
− | + | msg: "An item: {{ item }}" | |
with_items: | with_items: | ||
- 1 | - 1 | ||
- 2 | - 2 | ||
- 3 | - 3 | ||
+ | </nowiki> | ||
+ | </pre> | ||
Line 21: | Line 26: | ||
* [[Use loops in task (Ansible)]] | * [[Use loops in task (Ansible)]] | ||
* <code>[[set_fact]]</code> | * <code>[[set_fact]]</code> | ||
+ | * [[Terraform]]: <code>[[for_each]]</code> | ||
== See also == | == See also == |
Latest revision as of 15:58, 12 January 2023
This article is a Draft. Help us to complete it.
with_items:
Example[edit]
- name: "loop through list" ansible.builtin.debug: msg: "An item: {{ item }}" with_items: - 1 - 2 - 3
Related terms[edit]
See also[edit]
- Ansible: modules, plugins, Playbooks (examples)
ansible-playbook
,ansible-vault
,ansible-inventory
,ansible-config
, Ansible Tower, Ansible Galaxy (Roles) (ansible-galaxy
),ansible-cmdb
,gather facts
,ansible.cfg
,Ansible Molecule
, Ansible collections,register
,template
,--ask-pass
,--ask-become-pass
,remote_user:
,/etc/ansible/hosts
,ansible-doc
,ansible-lint
,.ansible/
,--forks
,--start-at-task
,changelog
,inventory
,Notify:
,ansible HOSTNAME -m ping
,gathering
,/usr/bin/ansible
,ansible -m ping
,ansible.builtin
,hosts: (Ansible)
,set fact:
,when:
,blockinfile:
,become method:
,include:
,git:
, AWX,ansible --help
, Tags, Ansible variables, versions
Advertising: