Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Use a default SSH key for this playbook
- set_fact: ansible_ssh_private_key_file={{ whatever_default_location }}
- when: ansible_ssh_private_key_file is not defined
- ---
- - hosts: localhost
- tasks:
- - set_fact: ansible_skip_tags={{ ansible_skip_tags + ['foo'] }}
- - debug: msg="Foo"
- tags:
- - foo
- PLAY [localhost] ******************************************************************************************************************************************************************************************************************************
- TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************
- ok: [localhost]
- TASK [set_fact] *******************************************************************************************************************************************************************************************************************************
- ok: [localhost]
- TASK [debug] **********************************************************************************************************************************************************************************************************************************
- ok: [localhost] => {
- "msg": "Foo"
- }
- PLAY RECAP ************************************************************************************************************************************************************************************************************************************
- localhost : ok=3 changed=0 unreachable=0 failed=0
- PLAY [localhost] ******************************************************************************************************************************************************************************************************************************
- TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************
- ok: [localhost]
- TASK [set_fact] *******************************************************************************************************************************************************************************************************************************
- ok: [localhost]
- PLAY RECAP ************************************************************************************************************************************************************************************************************************************
- localhost : ok=2 changed=0 unreachable=0 failed=0
- ---
- - hosts: localhost
- connection: local
- gather_facts: false
- tasks:
- - set_fact: ansible_skip_tags="{{ ansible_skip_tags }} + ['foo']"
- - debug: var=ansible_skip_tags
- $ ansible-playbook -i "localhost," test.yml --skip-tags=bar -v
- PLAY [localhost] ********************************************************************
- TASK [set_fact] *********************************************************************
- ok: [localhost] => {"ansible_facts": {"ansible_skip_tags": ["bar", "foo"]}, "changed": false}
- TASK [debug] ************************************************************************
- ok: [localhost] => {
- "ansible_skip_tags": [
- "bar"
- ]
- }
- PLAY RECAP **************************************************************************
- localhost : ok=2 changed=0 unreachable=0 failed=0
Add Comment
Please, Sign In to add comment