mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-25 07:56:38 +00:00
add static facility and apply to register (#49737)
* add static facility and apply to register * added warning * added test for templated register * test register 'static' status * rely on subshell to deal with quote context * use corrects pb for test * bring constants back cause new code in devel
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: template in register warns, but no template should not
|
||||
debug: msg=unimportant
|
||||
register: thisshouldnotwarn
|
||||
@@ -3,3 +3,5 @@
|
||||
set -eux
|
||||
|
||||
ansible-playbook test_templating_settings.yml -i ../../inventory -v "$@"
|
||||
ansible-playbook warn_on_register.yml -i ../../inventory -v "$@" 2>&1| grep 'is not templatable, but we found'
|
||||
[ "$(ansible-playbook dont_warn_register.yml -i ../../inventory -v "$@" 2>&1| grep -c 'is not templatable, but we found')" == "0" ]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
vars:
|
||||
thisshouldwarn: noreally
|
||||
tasks:
|
||||
- name: template in register warns
|
||||
debug: msg=unimportant
|
||||
register: '{{ thisshouldwarn }}'
|
||||
Reference in New Issue
Block a user