From ca0e3475a019cfbe4532ddee6b1d9e5c1191c93c Mon Sep 17 00:00:00 2001 From: sirkubax Date: Mon, 1 Jan 2018 21:31:22 +0100 Subject: update --- ansible.html.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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. -- cgit v1.2.3