mirror of
https://github.com/openshift/community.okd.git
synced 2026-04-07 16:53:07 +00:00
* Update tests for newer version of openshift (#254)
* Update tests for newer version of openshift
More recent versions of ocp no longer automatically create tokens for
service accounts. This updates the tests to manually create the tokens.
* Update nginx template version
The old image was EOL and the deployment was failing to deploy.
* Fix nginx version for all tasks
* Add missing var
* Remove openshift inventory plugin (#252)
* Remove openshift inventory plugin
This removes the openshift inventory plugin which has been deprecated
since version 3.0.0. The tests have been updated to retain coverage of
the connection plugin, which is still supported.
* Update version in Makefile
* CI fixes
* Update version info in build scripts
* Set ansible remote directory
The security policy on the pod is preventing ansible from writing to /.
Set it to /tmp which should be writable.
* Bump the ansible-lint version to 25.1.2 (#255)
* Bump the ansible-lint version to 25.1.2
* Update changelogs/fragments/ansible-lint-update.yml
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
---------
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
* Add ansible-lint to tox linters (#258)
* Add ansible-lint to tox linters
* Bump black
* Black formatting
* fix linting
* prepare release 4.0.2 (#262) (#263)
(cherry picked from commit 55ccaf3394)
* Update k8s dependency upper bounds (#257)
---------
Co-authored-by: Mike Graves <mgraves@redhat.com>
Co-authored-by: GomathiselviS <gomathiselvi@gmail.com>
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
Co-authored-by: Bianca Henderson <beeankha@gmail.com>
188 lines
5.3 KiB
YAML
188 lines
5.3 KiB
YAML
---
|
|
|
|
- name: Process a template in the cluster
|
|
community.okd.openshift_process:
|
|
name: nginx-example
|
|
namespace: openshift # only needed if using a template already on the server
|
|
parameters:
|
|
NAMESPACE: openshift
|
|
NAME: test123
|
|
NGINX_VERSION: "{{ nginx_version }}"
|
|
register: result
|
|
|
|
- name: Create the rendered resources
|
|
community.okd.k8s:
|
|
namespace: process-test
|
|
definition: '{{ item }}'
|
|
wait: yes
|
|
apply: yes
|
|
loop: '{{ result.resources }}'
|
|
|
|
- name: Delete the rendered resources
|
|
community.okd.k8s:
|
|
namespace: process-test
|
|
definition: '{{ item }}'
|
|
wait: yes
|
|
state: absent
|
|
loop: '{{ result.resources }}'
|
|
|
|
- name: Process a template and create the resources in the cluster
|
|
community.okd.openshift_process:
|
|
name: nginx-example
|
|
namespace: openshift # only needed if using a template already on the server
|
|
parameters:
|
|
NAMESPACE: openshift
|
|
NAME: test123
|
|
NGINX_VERSION: "{{ nginx_version }}"
|
|
state: present
|
|
namespace_target: process-test
|
|
register: result
|
|
|
|
- name: Process a template and update the resources in the cluster
|
|
community.okd.openshift_process:
|
|
name: nginx-example
|
|
namespace: openshift # only needed if using a template already on the server
|
|
parameters:
|
|
NAMESPACE: openshift
|
|
NAME: test123
|
|
MEMORY_LIMIT: 1Gi
|
|
NGINX_VERSION: "{{ nginx_version }}"
|
|
state: present
|
|
namespace_target: process-test
|
|
register: result
|
|
|
|
- name: Process a template and delete the resources in the cluster
|
|
community.okd.openshift_process:
|
|
name: nginx-example
|
|
namespace: openshift # only needed if using a template already on the server
|
|
parameters:
|
|
NAMESPACE: openshift
|
|
NAME: test123
|
|
NGINX_VERSION: "{{ nginx_version }}"
|
|
state: absent
|
|
namespace_target: process-test
|
|
register: result
|
|
|
|
- name: Process a template with parameters from an env file and create the resources
|
|
community.okd.openshift_process:
|
|
name: nginx-example
|
|
namespace: openshift
|
|
namespace_target: process-test
|
|
parameter_file: '{{ files_dir }}/nginx.env'
|
|
state: present
|
|
wait: yes
|
|
|
|
- name: Process a template with parameters from an env file and delete the resources
|
|
community.okd.openshift_process:
|
|
name: nginx-example
|
|
namespace: openshift
|
|
namespace_target: process-test
|
|
parameter_file: '{{ files_dir }}/nginx.env'
|
|
state: absent
|
|
wait: yes
|
|
|
|
|
|
- name: Process a template with duplicate values
|
|
community.okd.openshift_process:
|
|
name: nginx-example
|
|
namespace: openshift # only needed if using a template already on the server
|
|
parameters:
|
|
NAME: test123
|
|
parameter_file: '{{ files_dir }}/nginx.env'
|
|
ignore_errors: yes
|
|
register: result
|
|
|
|
- name: Assert the expected failure occurred
|
|
assert:
|
|
that:
|
|
- result.msg is defined
|
|
- result.msg == "Duplicate value for 'NAME' detected in parameter file"
|
|
|
|
- name: Process a local template
|
|
community.okd.openshift_process:
|
|
src: '{{ files_dir }}/simple-template.yaml'
|
|
parameter_file: '{{ files_dir }}/example.env'
|
|
register: rendered
|
|
|
|
- name: Process a local template and create the resources
|
|
community.okd.openshift_process:
|
|
src: '{{ files_dir }}/simple-template.yaml'
|
|
parameter_file: '{{ files_dir }}/example.env'
|
|
namespace_target: process-test
|
|
state: present
|
|
register: result
|
|
|
|
- assert:
|
|
that: result is changed
|
|
|
|
- name: Create the processed resources
|
|
community.okd.k8s:
|
|
namespace: process-test
|
|
definition: '{{ item }}'
|
|
loop: '{{ rendered.resources }}'
|
|
register: result
|
|
|
|
- assert:
|
|
that: result is not changed
|
|
|
|
- name: Process a local template and create the resources
|
|
community.okd.openshift_process:
|
|
definition: "{{ lookup('template', files_dir + '/simple-template.yaml') | from_yaml }}"
|
|
parameter_file: '{{ files_dir }}/example.env'
|
|
namespace_target: process-test
|
|
state: present
|
|
register: result
|
|
|
|
- assert:
|
|
that: result is not changed
|
|
|
|
- name: Get the created configmap
|
|
kubernetes.core.k8s_info:
|
|
api_version: v1
|
|
kind: ConfigMap
|
|
name: example
|
|
namespace: process-test
|
|
register: templated_cm
|
|
|
|
- assert:
|
|
that:
|
|
- (templated_cm.resources | length) == 1
|
|
- templated_cm.resources.0.data.content is defined
|
|
- templated_cm.resources.0.data.content == "This is a long message that may take one or more lines to parse but should still work without issue"
|
|
|
|
- name: Create the Template resource
|
|
community.okd.k8s:
|
|
src: '{{ files_dir }}/simple-template.yaml'
|
|
namespace: process-test
|
|
|
|
- name: Process the template and create the resources
|
|
community.okd.openshift_process:
|
|
name: simple-example
|
|
namespace: process-test # only needed if using a template already on the server
|
|
namespace_target: process-test
|
|
parameter_file: '{{ files_dir }}/example.env'
|
|
state: present
|
|
register: result
|
|
|
|
- assert:
|
|
that: result is not changed
|
|
|
|
# Processing template without message
|
|
- name: create template with file {{ files_dir }}/pod-template.yaml
|
|
kubernetes.core.k8s:
|
|
namespace: process-test
|
|
src: "{{ files_dir }}/pod-template.yaml"
|
|
state: present
|
|
|
|
- name: Process pod template
|
|
community.okd.openshift_process:
|
|
name: pod-template
|
|
namespace: process-test
|
|
state: rendered
|
|
parameters:
|
|
NAME: ansible
|
|
register: rendered_template
|
|
|
|
- assert:
|
|
that: rendered_template.message == ""
|