mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
openshift: validate when applying objects
Right now if there's a yml thats indented incorrectly, but parts of it are fine, oc apply will apply those parts that are valid and just ignore the rest. So, lets add a --validate=strict to have it reject these entirely, so we know they have something wrong in them and we can fix it, rather than being confused that they didn't apply anything. Signed-off-by: Kevin Fenzi kevin@scrye.com
This commit is contained in:
@@ -14,5 +14,5 @@
|
||||
register: object_file
|
||||
|
||||
- name: Call `oc apply` on the copied file
|
||||
shell: oc -n {{os_app}} apply -f /etc/openshift_apps/{{os_app}}/{{objectname}}
|
||||
shell: oc -n {{os_app}} apply --validate=strict -f /etc/openshift_apps/{{os_app}}/{{objectname}}
|
||||
when: object_template.changed or object_template_fullpath.changed or object_file.changed
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
dest=/etc/openshift_apps/{{app}}/project.yml
|
||||
|
||||
- name: Create project
|
||||
shell: oc apply -f /etc/openshift_apps/{{app}}/project.yml
|
||||
shell: oc apply -f --validate=strict /etc/openshift_apps/{{app}}/project.yml
|
||||
when: "'not found' in project_exists.stderr"
|
||||
|
||||
- name: deployer.yml
|
||||
|
||||
Reference in New Issue
Block a user