mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Add smoke test that verifies that basic jobs work
This commit is contained in:
@@ -8,6 +8,8 @@ spec:
|
|||||||
foo: bar
|
foo: bar
|
||||||
deployment_type: awx
|
deployment_type: awx
|
||||||
ingress_type: ingress
|
ingress_type: ingress
|
||||||
|
ingress_annotations: |
|
||||||
|
kubernetes.io/ingress.class: nginx
|
||||||
web_resource_requirements:
|
web_resource_requirements:
|
||||||
requests:
|
requests:
|
||||||
cpu: 250m
|
cpu: 250m
|
||||||
|
|||||||
@@ -13,7 +13,18 @@
|
|||||||
vars:
|
vars:
|
||||||
cr_file: 'awx_v1beta1_awx.yaml'
|
cr_file: 'awx_v1beta1_awx.yaml'
|
||||||
|
|
||||||
# - name: Add assertions here
|
- name: Obtain generated admin password
|
||||||
# assert:
|
k8s_info:
|
||||||
# that: false
|
namespace: '{{ namespace }}'
|
||||||
# fail_msg: FIXME Add real assertions for your operator
|
kind: Secret
|
||||||
|
name: example-awx-admin-password
|
||||||
|
register: admin_pw_secret
|
||||||
|
|
||||||
|
- name: Launch Demo Job Template
|
||||||
|
awx.awx.job_launch:
|
||||||
|
name: Demo Job Template
|
||||||
|
wait: yes
|
||||||
|
validate_certs: no
|
||||||
|
controller_host: localhost
|
||||||
|
controller_username: admin
|
||||||
|
controller_password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}"
|
||||||
|
|||||||
@@ -5,4 +5,23 @@
|
|||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create test kind cluster
|
- name: Create test kind cluster
|
||||||
command: kind create cluster --name osdk-test --kubeconfig {{ kubeconfig }}
|
shell: |
|
||||||
|
cat <<EOF | kind create cluster --name osdk-test --kubeconfig {{ kubeconfig }} --config=-
|
||||||
|
kind: Cluster
|
||||||
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
|
nodes:
|
||||||
|
- role: control-plane
|
||||||
|
kubeadmConfigPatches:
|
||||||
|
- |
|
||||||
|
kind: InitConfiguration
|
||||||
|
nodeRegistration:
|
||||||
|
kubeletExtraArgs:
|
||||||
|
node-labels: "ingress-ready=true"
|
||||||
|
extraPortMappings:
|
||||||
|
- containerPort: 80
|
||||||
|
hostPort: 80
|
||||||
|
protocol: TCP
|
||||||
|
- containerPort: 443
|
||||||
|
hostPort: 443
|
||||||
|
protocol: TCP
|
||||||
|
EOF
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ platforms:
|
|||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
playbooks:
|
playbooks:
|
||||||
prepare: ../default/prepare.yml
|
|
||||||
verify: ../default/verify.yml
|
verify: ../default/verify.yml
|
||||||
lint: |
|
lint: |
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
29
molecule/kind/prepare.yml
Normal file
29
molecule/kind/prepare.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
- name: Prepare
|
||||||
|
hosts: localhost
|
||||||
|
connection: local
|
||||||
|
gather_facts: false
|
||||||
|
collections:
|
||||||
|
- kubernetes.core
|
||||||
|
vars:
|
||||||
|
nginx_ingress_definition: 'https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml'
|
||||||
|
tasks:
|
||||||
|
- name: Install NGINX ingress
|
||||||
|
k8s:
|
||||||
|
definition: |
|
||||||
|
{{ lookup('url', nginx_ingress_definition, split_lines=False) | from_yaml_all }}
|
||||||
|
|
||||||
|
- name: Wait for NGINX ingress to become available
|
||||||
|
k8s_info:
|
||||||
|
kind: Pod
|
||||||
|
namespace: ingress-nginx
|
||||||
|
label_selectors:
|
||||||
|
- app.kubernetes.io/component=controller
|
||||||
|
wait: yes
|
||||||
|
wait_timeout: 30
|
||||||
|
wait_condition:
|
||||||
|
type: Ready
|
||||||
|
register: result # For some reason, this task always fails on the first try...
|
||||||
|
until: result is not failed
|
||||||
|
|
||||||
|
- import_playbook: ../default/prepare.yml
|
||||||
Reference in New Issue
Block a user