Add simple module test

This commit is contained in:
Chris Houseknecht
2017-10-11 13:15:16 -04:00
parent 3797eb3148
commit 1b9adeaf5e
4 changed files with 48 additions and 9 deletions

View File

@@ -1 +1 @@
localhost
localhost ansible_connection=local

View File

@@ -3,6 +3,9 @@
name: hello
state: absent
debug: yes
kubeconfig: '{{ os_kubeconfig }}'
host: '{{ os_host }}'
verify_ssl: '{{ os_verify_ssl }}'
register: delete_project
- debug: var=delete_project
@@ -14,6 +17,9 @@
display_name: Hello World
description: Hello.
debug: yes
kubeconfig: '{{ os_kubeconfig }}'
host: '{{ os_host }}'
verify_ssl: '{{ os_verify_ssl }}'
register: create_project
- debug: var=create_project
@@ -32,6 +38,9 @@
labels:
app: hello
debug: yes
kubeconfig: '{{ os_kubeconfig }}'
host: '{{ os_host }}'
verify_ssl: '{{ os_verify_ssl }}'
register: create_service
- debug: var=create_service
@@ -61,6 +70,9 @@
selector:
app: hello
strategy_type: Rolling
kubeconfig: '{{ os_kubeconfig }}'
host: '{{ os_host }}'
verify_ssl: '{{ os_verify_ssl }}'
register: create_deployment
- debug: var=create_deployment
@@ -75,6 +87,9 @@
to_weight: 100
port_target_port: web-tcp
tls_termination: edge
kubeconfig: '{{ os_kubeconfig }}'
host: '{{ os_host }}'
verify_ssl: '{{ os_verify_ssl }}'
register: create_route
- debug: var=create_route

View File

@@ -1,9 +1,23 @@
---
- hosts: localhost
remote_user: root
- hosts: all
gather_facts: no
vars:
kubeconfig: ../konfig.json
host: localhost:8443
verify_ssl: False
roles:
- role: ansible-kubernetes-modules
install_python_requirements: no
- role: hello-world
- role: hello-templates
- role: hello-world
os_kubeconfig: '{{ kubeconfig }}'
os_host: '{{ host }}'
os_verify_ssl: '{{ verify_ssl }}'
# - role: hello-templates
# kubeconfig: '{{ kubeconfig }}'
# host: '{{ host }}'
# verify_ssl: '{{ verify_ssl }}'