diff options
author | Michal Zegan <m.zegan@samsung.com> | 2019-06-06 17:49:51 +0200 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-01-16 11:19:46 +0000 |
commit | 23ba267911f1b9b7120ea45f9f40f27ed144ade8 (patch) | |
tree | f9c331e80e7fa35a3201ba030698b13d74efbdda /ansible | |
parent | cb3f68d8bcecb6ff55b223d16e7f91c871fb30b6 (diff) |
Add tests for rke playbook
This adds tests for the rke playbook.
Change-Id: Idbb90bb9674d67c1877302877b60d3d60d44e36b
Issue-ID: OOM-1907
Signed-off-by: Michal Zegan <m.zegan@samsung.com>
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/test/play-rke/.yamllint | 11 | ||||
-rw-r--r-- | ansible/test/play-rke/molecule/default/molecule.yml | 55 | ||||
-rw-r--r-- | ansible/test/play-rke/molecule/default/playbook.yml | 11 | ||||
-rw-r--r-- | ansible/test/play-rke/molecule/default/prepare.yml | 22 | ||||
-rw-r--r-- | ansible/test/play-rke/molecule/default/vars.yml | 3 |
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 }}" |