mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-14 13:32:14 +00:00
Add simple module test
This commit is contained in:
16
.travis.yml
16
.travis.yml
@@ -13,17 +13,27 @@ addons:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
# Install ansible
|
# Install ansible
|
||||||
- pip install ansible
|
- pip install https://github.com/ansible/ansible/archive/devel.tar.gz
|
||||||
|
|
||||||
# Check ansible version
|
# Check ansible version
|
||||||
- ansible --version
|
- ansible --version
|
||||||
|
|
||||||
|
- pip install . -e
|
||||||
|
|
||||||
# Create ansible.cfg with correct roles_path
|
# Create ansible.cfg with correct roles_path
|
||||||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
||||||
|
|
||||||
|
# Start OpenShift
|
||||||
|
- docker run --publish 8443:8443 -d --name openshift openshift/origin:v3.6.0 start master --listen https://0.0.0.0:8443
|
||||||
|
|
||||||
|
# Wait for the container state to be running
|
||||||
|
- sleep 15
|
||||||
|
|
||||||
|
# Fetch a copy of the kube config file
|
||||||
|
- docker exec -it openshift cat /var/lib/origin/openshift.local.config/master/admin.kubeconfig >konfig.json
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# Basic role syntax check
|
- ansible-playbook tests/test.yml -i tests/inventory
|
||||||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||||
@@ -1 +1 @@
|
|||||||
localhost
|
localhost ansible_connection=local
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
name: hello
|
name: hello
|
||||||
state: absent
|
state: absent
|
||||||
debug: yes
|
debug: yes
|
||||||
|
kubeconfig: '{{ os_kubeconfig }}'
|
||||||
|
host: '{{ os_host }}'
|
||||||
|
verify_ssl: '{{ os_verify_ssl }}'
|
||||||
register: delete_project
|
register: delete_project
|
||||||
|
|
||||||
- debug: var=delete_project
|
- debug: var=delete_project
|
||||||
@@ -14,6 +17,9 @@
|
|||||||
display_name: Hello World
|
display_name: Hello World
|
||||||
description: Hello.
|
description: Hello.
|
||||||
debug: yes
|
debug: yes
|
||||||
|
kubeconfig: '{{ os_kubeconfig }}'
|
||||||
|
host: '{{ os_host }}'
|
||||||
|
verify_ssl: '{{ os_verify_ssl }}'
|
||||||
register: create_project
|
register: create_project
|
||||||
|
|
||||||
- debug: var=create_project
|
- debug: var=create_project
|
||||||
@@ -32,6 +38,9 @@
|
|||||||
labels:
|
labels:
|
||||||
app: hello
|
app: hello
|
||||||
debug: yes
|
debug: yes
|
||||||
|
kubeconfig: '{{ os_kubeconfig }}'
|
||||||
|
host: '{{ os_host }}'
|
||||||
|
verify_ssl: '{{ os_verify_ssl }}'
|
||||||
register: create_service
|
register: create_service
|
||||||
|
|
||||||
- debug: var=create_service
|
- debug: var=create_service
|
||||||
@@ -61,6 +70,9 @@
|
|||||||
selector:
|
selector:
|
||||||
app: hello
|
app: hello
|
||||||
strategy_type: Rolling
|
strategy_type: Rolling
|
||||||
|
kubeconfig: '{{ os_kubeconfig }}'
|
||||||
|
host: '{{ os_host }}'
|
||||||
|
verify_ssl: '{{ os_verify_ssl }}'
|
||||||
register: create_deployment
|
register: create_deployment
|
||||||
|
|
||||||
- debug: var=create_deployment
|
- debug: var=create_deployment
|
||||||
@@ -75,6 +87,9 @@
|
|||||||
to_weight: 100
|
to_weight: 100
|
||||||
port_target_port: web-tcp
|
port_target_port: web-tcp
|
||||||
tls_termination: edge
|
tls_termination: edge
|
||||||
|
kubeconfig: '{{ os_kubeconfig }}'
|
||||||
|
host: '{{ os_host }}'
|
||||||
|
verify_ssl: '{{ os_verify_ssl }}'
|
||||||
register: create_route
|
register: create_route
|
||||||
|
|
||||||
- debug: var=create_route
|
- debug: var=create_route
|
||||||
|
|||||||
@@ -1,9 +1,23 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: all
|
||||||
remote_user: root
|
gather_facts: no
|
||||||
|
|
||||||
|
vars:
|
||||||
|
kubeconfig: ../konfig.json
|
||||||
|
host: localhost:8443
|
||||||
|
verify_ssl: False
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: ansible-kubernetes-modules
|
- role: ansible-kubernetes-modules
|
||||||
install_python_requirements: no
|
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 }}'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user