diff options
| author | sirkubax <muszynski@so1.net> | 2018-01-01 21:31:22 +0100 | 
|---|---|---|
| committer | sirkubax <muszynski@so1.net> | 2018-01-01 21:31:22 +0100 | 
| commit | ca0e3475a019cfbe4532ddee6b1d9e5c1191c93c (patch) | |
| tree | 780d3a3aaa0dc5d8f61b808287ec2b812b6dc328 | |
| parent | 91a81abb7de572b5fb595f641688b75144de5b75 (diff) | |
update
| -rw-r--r-- | ansible.html.markdown | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/ansible.html.markdown b/ansible.html.markdown index e4023e5a..bca1331c 100644 --- a/ansible.html.markdown +++ b/ansible.html.markdown @@ -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. | 
