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:
@@ -13,7 +13,18 @@
|
||||
vars:
|
||||
cr_file: 'awx_v1beta1_awx.yaml'
|
||||
|
||||
# - name: Add assertions here
|
||||
# assert:
|
||||
# that: false
|
||||
# fail_msg: FIXME Add real assertions for your operator
|
||||
- name: Obtain generated admin password
|
||||
k8s_info:
|
||||
namespace: '{{ namespace }}'
|
||||
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
|
||||
tasks:
|
||||
- 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:
|
||||
name: ansible
|
||||
playbooks:
|
||||
prepare: ../default/prepare.yml
|
||||
verify: ../default/verify.yml
|
||||
lint: |
|
||||
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