mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
update
This commit is contained in:
parent
91a81abb7d
commit
ca0e3475a0
@ -320,6 +320,8 @@ You can tag a task, role (and its tasks), include, etc, and then run only the ta
|
||||
--skip-tags can be used to exclude a block of code
|
||||
--list-tags to list available tags
|
||||
|
||||
[Read more](http://docs.ansible.com/ansible/latest/playbooks_tags.html)
|
||||
|
||||
#### LIMIT
|
||||
You can limit an execution of your tasks to defined hosts
|
||||
|
||||
@ -350,6 +352,20 @@ You can use the jinja in the CLI too
|
||||
```bash
|
||||
ansible -m shell -a 'echo {{ my_variable }}` -e 'my_variable=something, playbook_parameter=twentytwo" localhost
|
||||
```
|
||||
In fact - jinja is used to template parts of the playbooks too
|
||||
```yml
|
||||
#check part of this playbook: playbooks/roles/sys_debug/tasks/debug_time.yml
|
||||
- local_action: shell date +'%F %T'
|
||||
register: ts
|
||||
become: False
|
||||
changed_when: False
|
||||
|
||||
- name: Timestamp
|
||||
debug: msg="{{ ts.stdout }}"
|
||||
when: ts is defined and ts.stdout is defined
|
||||
become: False
|
||||
|
||||
```
|
||||
|
||||
#### Jinja2 filters
|
||||
Junja is powerfull. It has built-in many usefull functions.
|
||||
|
Loading…
Reference in New Issue
Block a user