This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow use of templated booleans for become (#262)
- Loading branch information
Showing
9 changed files
with
141 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ fbca | |
fcba | ||
fileglob | ||
filetree | ||
firewalld | ||
geerlingguy | ||
goss | ||
groupname | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- hosts: localhost | ||
become: yes # <- invalid based on json schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# ajv errors | ||
|
||
```json | ||
[ | ||
{ | ||
"instancePath": "/0", | ||
"keyword": "required", | ||
"message": "must have required property 'ansible.builtin.import_playbook'", | ||
"params": { | ||
"missingProperty": "ansible.builtin.import_playbook" | ||
}, | ||
"schemaPath": "#/definitions/ansible.builtin.import_playbook/required" | ||
}, | ||
{ | ||
"instancePath": "/0", | ||
"keyword": "additionalProperties", | ||
"message": "must NOT have additional properties", | ||
"params": { | ||
"additionalProperty": "hosts" | ||
}, | ||
"schemaPath": "#/definitions/ansible.builtin.import_playbook/additionalProperties" | ||
}, | ||
{ | ||
"instancePath": "/0", | ||
"keyword": "additionalProperties", | ||
"message": "must NOT have additional properties", | ||
"params": { | ||
"additionalProperty": "become" | ||
}, | ||
"schemaPath": "#/definitions/ansible.builtin.import_playbook/additionalProperties" | ||
}, | ||
{ | ||
"instancePath": "/0/become", | ||
"keyword": "type", | ||
"message": "must be boolean", | ||
"params": { | ||
"type": "boolean" | ||
}, | ||
"schemaPath": "#/oneOf/0/type" | ||
}, | ||
{ | ||
"instancePath": "/0/become", | ||
"keyword": "pattern", | ||
"message": "must match pattern \"^\\{\\{.*\\}\\}$\"", | ||
"params": { | ||
"pattern": "^\\{\\{.*\\}\\}$" | ||
}, | ||
"schemaPath": "#/definitions/full-jinja/pattern" | ||
}, | ||
{ | ||
"instancePath": "/0/become", | ||
"keyword": "oneOf", | ||
"message": "must match exactly one schema in oneOf", | ||
"params": { | ||
"passingSchemas": null | ||
}, | ||
"schemaPath": "#/oneOf" | ||
}, | ||
{ | ||
"instancePath": "/0", | ||
"keyword": "anyOf", | ||
"message": "must match a schema in anyOf", | ||
"params": {}, | ||
"schemaPath": "#/items/anyOf" | ||
} | ||
] | ||
``` | ||
|
||
# check-jsonschema | ||
|
||
stderr: | ||
|
||
``` | ||
Schema validation errors were encountered. | ||
``` | ||
|
||
stdout: | ||
|
||
``` | ||
negative_test/playbooks/invalid_become.yml::$[0]: {'hosts': 'localhost', 'become': 'yes'} is not valid under any of the given schemas | ||
Underlying errors caused this. | ||
Best Match: | ||
$[0]: Additional properties are not allowed ('become', 'hosts' were unexpected) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- name: foo | ||
ansible.builtin.debug: | ||
msg: foo! | ||
become: "{{ firewalld_become }}" # <- valid | ||
|
||
- name: foo block | ||
become: "{{ firewalld_become }}" # <- valid | ||
block: | ||
- name: foo | ||
ansible.builtin.debug: | ||
msg: foo! | ||
become: "{{ firewalld_become }}" # <- valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- hosts: localhost | ||
become: "{{ firewalld_become }}" # <- valid | ||
tasks: | ||
- name: foo | ||
ansible.builtin.debug: | ||
msg: foo! | ||
become: "{{ firewalld_become }}" # <- valid | ||
|
||
- name: foo block | ||
become: "{{ firewalld_become }}" # <- valid | ||
block: | ||
- name: foo | ||
ansible.builtin.debug: | ||
msg: foo! | ||
become: "{{ firewalld_become }}" # <- valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters