mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-08 06:12:54 +00:00
Issue #1: Get a minikube configuration working for local Molecule testing.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Get tower Pod data
|
||||
k8s_facts:
|
||||
k8s_info:
|
||||
kind: Pod
|
||||
namespace: example-tower
|
||||
label_selectors:
|
||||
@@ -18,10 +18,3 @@
|
||||
- name: Verify there is one tower pod
|
||||
assert:
|
||||
that: '{{ (tower_pods.resources | length) == 1 }}'
|
||||
|
||||
- name: Verify tower functionality
|
||||
hosts: k8s
|
||||
|
||||
vars: []
|
||||
|
||||
tasks: []
|
||||
|
||||
@@ -1,35 +1,28 @@
|
||||
---
|
||||
- name: Prepare
|
||||
hosts: k8s
|
||||
gather_facts: no
|
||||
- name: Prepare operator resources
|
||||
hosts: localhost
|
||||
connection: local
|
||||
|
||||
vars:
|
||||
kubeconfig: "{{ lookup('env', 'KUBECONFIG') }}"
|
||||
ansible_python_interpreter: '{{ ansible_playbook_python }}'
|
||||
deploy_dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/deploy"
|
||||
|
||||
tasks:
|
||||
- name: delete the kubeconfig if present
|
||||
file:
|
||||
path: '{{ kubeconfig }}'
|
||||
state: absent
|
||||
delegate_to: localhost
|
||||
- name: Create Custom Resource Definition
|
||||
k8s:
|
||||
definition: "{{ lookup('file', '/'.join([deploy_dir, 'crds/tower_v1alpha1_tower_crd.yaml'])) }}"
|
||||
|
||||
- name: Fetch the kubeconfig
|
||||
fetch:
|
||||
dest: '{{ kubeconfig }}'
|
||||
flat: yes
|
||||
src: /root/.kube/config
|
||||
- name: Ensure specified namespace is present
|
||||
k8s:
|
||||
api_version: v1
|
||||
kind: Namespace
|
||||
name: '{{ operator_namespace }}'
|
||||
|
||||
- name: Change the kubeconfig port to the proper value
|
||||
replace:
|
||||
regexp: 8443
|
||||
replace: "{{ lookup('env', 'KIND_PORT') }}"
|
||||
path: '{{ kubeconfig }}'
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Wait for the Kubernetes API to become available (this could take a minute)
|
||||
uri:
|
||||
url: "http://localhost:10080/kubernetes-ready"
|
||||
status_code: 200
|
||||
validate_certs: no
|
||||
register: result
|
||||
until: (result.status|default(-1)) == 200
|
||||
retries: 60
|
||||
delay: 5
|
||||
- name: Create RBAC resources
|
||||
k8s:
|
||||
definition: "{{ lookup('template', '/'.join([deploy_dir, item])) }}"
|
||||
namespace: '{{ operator_namespace }}'
|
||||
with_items:
|
||||
- role.yaml
|
||||
- role_binding.yaml
|
||||
- service_account.yaml
|
||||
|
||||
Reference in New Issue
Block a user