summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ansible/test/play-rke/.yamllint11
-rw-r--r--ansible/test/play-rke/molecule/default/molecule.yml55
-rw-r--r--ansible/test/play-rke/molecule/default/playbook.yml11
-rw-r--r--ansible/test/play-rke/molecule/default/prepare.yml22
-rw-r--r--ansible/test/play-rke/molecule/default/vars.yml3
5 files changed, 102 insertions, 0 deletions
diff --git a/ansible/test/play-rke/.yamllint b/ansible/test/play-rke/.yamllint
new file mode 100644
index 00000000..ad0be760
--- /dev/null
+++ b/ansible/test/play-rke/.yamllint
@@ -0,0 +1,11 @@
+extends: default
+
+rules:
+ braces:
+ max-spaces-inside: 1
+ level: error
+ brackets:
+ max-spaces-inside: 1
+ level: error
+ line-length: disable
+ truthy: disable
diff --git a/ansible/test/play-rke/molecule/default/molecule.yml b/ansible/test/play-rke/molecule/default/molecule.yml
new file mode 100644
index 00000000..b7e71bf5
--- /dev/null
+++ b/ansible/test/play-rke/molecule/default/molecule.yml
@@ -0,0 +1,55 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: infrastructure-server
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
+ pre_build_image: true
+ privileged: true
+ override_command: false
+ restart_policy: unless-stopped
+ volumes:
+ - /var/lib/docker
+ - /var/lib/kubelet
+ groups:
+ - infrastructure
+ - kubernetes-etcd
+ - kubernetes-control-plane
+ - kubernetes
+ networks:
+ - name: rke
+ purge_networks: true
+
+ - name: kubernetes-node-1
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
+ pre_build_image: true
+ privileged: true
+ override_command: false
+ restart_policy: unless-stopped
+ volumes:
+ - /var/lib/docker
+ - /var/lib/kubelet
+ groups:
+ - kubernetes
+ - kubernetes-node
+ networks:
+ - name: rke
+ purge_networks: true
+
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ ANSIBLE_LIBRARY: ../../../../library
+ lint:
+ name: ansible-lint
+scenario:
+ name: default
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/ansible/test/play-rke/molecule/default/playbook.yml b/ansible/test/play-rke/molecule/default/playbook.yml
new file mode 100644
index 00000000..aa2e0df2
--- /dev/null
+++ b/ansible/test/play-rke/molecule/default/playbook.yml
@@ -0,0 +1,11 @@
+---
+- name: Initialize
+ hosts: all
+ tasks:
+ - name: Set cluster_ip fact
+ set_fact:
+ cluster_ip: "{{ ansible_default_ipv4.address }}"
+ - name: Include variables
+ include_vars: vars.yml
+
+- import_playbook: ../../../../rke.yml
diff --git a/ansible/test/play-rke/molecule/default/prepare.yml b/ansible/test/play-rke/molecule/default/prepare.yml
new file mode 100644
index 00000000..ad6f0495
--- /dev/null
+++ b/ansible/test/play-rke/molecule/default/prepare.yml
@@ -0,0 +1,22 @@
+---
+- name: Prepare for all
+ hosts: all
+ roles:
+ - prepare-docker-dind
+ - role: prepare-rke
+ vars:
+ mode: all
+
+- name: Prepare infra
+ hosts: infrastructure
+ pre_tasks:
+ - name: Include infrastructure group variables
+ include_vars: ../../../../group_vars/infrastructure.yml
+ roles:
+ - role: prepare-rke
+ vars:
+ mode: infra
+ - prepare-kubectl
+ - prepare-helm
+ vars_files:
+ vars.yml
diff --git a/ansible/test/play-rke/molecule/default/vars.yml b/ansible/test/play-rke/molecule/default/vars.yml
new file mode 100644
index 00000000..fa5b60e3
--- /dev/null
+++ b/ansible/test/play-rke/molecule/default/vars.yml
@@ -0,0 +1,3 @@
+---
+app_name: moleculeapp
+app_data_path: "/opt/{{ app_name }}"