차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
ansible_summary [2018/09/05 02:16] – [Inventory files] koov | ansible_summary [2018/10/04 02:25] (현재) – koov | ||
---|---|---|---|
줄 22: | 줄 22: | ||
==== Speial sections: ==== | ==== Speial sections: ==== | ||
- | * [foo: | + | * ''< |
- | * [foo:vars]: variable definitions for all members of group foo | + | * ''< |
==== Variable files: ==== | ==== Variable files: ==== | ||
- | YAML; given inventory file at .../hosts: | + | YAML; given inventory file at '' |
- | * ...group_vars/ | + | * '' |
- | * ...host_vars/ | + | * '' |
- | * | + | |
==== Behavorial inventory parameters: ==== | ==== Behavorial inventory parameters: ==== | ||
* ansible_ssh_host | * ansible_ssh_host | ||
줄 137: | 줄 136: | ||
==== Substitution examples: ==== | ==== Substitution examples: ==== | ||
- | * {{ var }} | + | * ''< |
- | * {{ var[" | + | * ''< |
- | * {{ var.key1.key2 }} | + | * ''< |
- | * {{ list[0] }} | + | * ''< |
==== Souces: ==== | ==== Souces: ==== | ||
* Highest priority: | * Highest priority: | ||
- | * --extra-vars on the command line | + | * ''< |
* General: | * General: | ||
- | * vars component of a playbook | + | * '' |
- | * From files referenced by vars_file in a playbook | + | * From files referenced by '' |
* From included files (incl. roles) | * From included files (incl. roles) | ||
* Paameters passed to includes | * Paameters passed to includes | ||
* Facts (see below) | * Facts (see below) | ||
- | * Any / | + | * Any '' |
- | * register: in tasks | + | * '' |
* Lower priority: | * Lower priority: | ||
줄 161: | 줄 160: | ||
==== Built-in: ==== | ==== Built-in: ==== | ||
- | * hostvars (e.g. hostvars[other.example.com][...]) | + | * '' |
- | * group_names (groups containing current host) | + | * '' |
- | * groups (all groups and hosts in the inventory) | + | * '' |
- | * inventory_hostname (current host as in inventory) | + | * '' |
- | * inventory_hostname_short (first component of inventory_hostname) | + | * '' |
- | * play_hosts (hostnames in scope for current play) | + | * '' |
- | * inventory_dir (location of the inventory) | + | * '' |
- | * inventoty_file (name of the inventory) | + | * '' |
==== Facts: ==== | ==== Facts: ==== | ||
줄 203: | 줄 202: | ||
===== Filters ===== | ===== Filters ===== | ||
- | * {{ var | to_nice_json }} | + | * < |
- | * {{ var | to_json }} | + | * < |
- | * {{ var | from_json }} | + | * < |
- | * {{ var | to_nice_yml }} | + | * < |
- | * {{ var | to_yml }} | + | * < |
- | * {{ var | from_yml }} | + | * < |
- | * {{ result | failed }} | + | * < |
- | * {{ result | changed }} | + | * < |
- | * {{ result | success }} | + | * < |
- | * {{ result | skipped }} | + | * < |
- | * {{ var | manditory }} | + | * < |
- | * {{ var | default(5) }} | + | * < |
- | * {{ list1 | unique }} | + | * < |
- | * {{ list1 | union(list2) }} | + | * < |
- | * {{ list1 | intersect(list2) }} | + | * < |
- | * {{ list1 | difference(list2) }} | + | * < |
- | * {{ list1 | symmetric_difference(list2) }} | + | * < |
- | * {{ path | basename }} | + | * < |
- | * {{ path | dirname }} | + | * < |
- | * {{ path | expanduser }} | + | * < |
- | * {{ path | realpath }} | + | * < |
- | * {{ var | b64decode }} | + | * < |
- | * {{ var | b64encode }} | + | * < |
- | * {{ filename | md5 }} | + | * < |
- | * {{ var | bool }} | + | * < |
- | * {{ var | int }} | + | * < |
- | * {{ var | quote }} | + | * < |
- | * {{ var | md5 }} | + | * < |
- | * {{ var | fileglob }} | + | * < |
- | * {{ var | match }} | + | * < |
- | * {{ var | search }} | + | * < |
- | * {{ var | regex }} | + | * < |
See also [[http:// | See also [[http:// | ||
줄 240: | 줄 239: | ||
===== Lookups ===== | ===== Lookups ===== | ||
- | * {{ lookup(' | + | * < |
- | * {{ lookup(' | + | * < |
- | * {{ lookup(' | + | * < |
- | * {{ lookup(' | + | * < |
- | * {{ lookup(' | + | * < |
- | * {{ lookup(' | + | * < |
- | * {{ lookup(' | + | * < |
===== Conditions ===== | ===== Conditions ===== | ||
줄 252: | 줄 251: | ||
'' | '' | ||
- | * var == " | + | * '' |
- | * var, where var coreces to boolean (yes, true, True, TRUE) | + | * '' |
- | * var is defined, var is not defined | + | * '' |
- | * < | + | * ''< |
Combined with '' | Combined with '' | ||
줄 461: | 줄 460: | ||
==== First found: ==== | ==== First found: ==== | ||
+ | <WRAP prewrap> | ||
+ | <code yaml> | ||
- name: template a file | - name: template a file | ||
template: src={{ item }} dest=/ | template: src={{ item }} dest=/ | ||
줄 704: | 줄 705: | ||
==== ansible-pull ==== | ==== ansible-pull ==== | ||
+ | <WRAP prewrap> | ||
+ | <code bash> | ||
Usage: ansible-pull [options] [playbook.yml] | Usage: ansible-pull [options] [playbook.yml] | ||