summaryrefslogtreecommitdiffstats
path: root/ansible/roles/rke/molecule
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/rke/molecule')
l---------ansible/roles/rke/molecule/default/group_vars1
-rw-r--r--ansible/roles/rke/molecule/default/molecule.yml21
-rw-r--r--ansible/roles/rke/molecule/default/playbook.yml7
-rw-r--r--ansible/roles/rke/molecule/default/tests/test_infrastructure.py2
l---------ansible/roles/rke/molecule/etcd_storage/group_vars1
-rw-r--r--ansible/roles/rke/molecule/etcd_storage/molecule.yml74
6 files changed, 84 insertions, 22 deletions
diff --git a/ansible/roles/rke/molecule/default/group_vars b/ansible/roles/rke/molecule/default/group_vars
new file mode 120000
index 00000000..e04e088f
--- /dev/null
+++ b/ansible/roles/rke/molecule/default/group_vars
@@ -0,0 +1 @@
+../../../../group_vars/ \ No newline at end of file
diff --git a/ansible/roles/rke/molecule/default/molecule.yml b/ansible/roles/rke/molecule/default/molecule.yml
index 6ae613a9..3078c115 100644
--- a/ansible/roles/rke/molecule/default/molecule.yml
+++ b/ansible/roles/rke/molecule/default/molecule.yml
@@ -44,32 +44,11 @@ platforms:
- name: rke
purge_networks: true
- - name: kubernetes-node-2
- image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
- pre_build_image: true
- privileged: true
- override_command: false
- restart_policy: unless-stopped
- env:
- container: docker
- volumes:
- - /var/lib/kubelet
- - /var/lib/docker
- groups:
- - kubernetes
- - kubernetes-node
- networks:
- - name: rke
- purge_networks: true
-
provisioner:
name: ansible
env:
ANSIBLE_ROLES_PATH: ../../../../test/roles
ANSIBLE_LIBRARY: ../../../../library
- inventory:
- links:
- group_vars: ../../../../group_vars
options:
e: "app_data_path=/opt/onap"
lint:
diff --git a/ansible/roles/rke/molecule/default/playbook.yml b/ansible/roles/rke/molecule/default/playbook.yml
index 33345ed9..8db7aef5 100644
--- a/ansible/roles/rke/molecule/default/playbook.yml
+++ b/ansible/roles/rke/molecule/default/playbook.yml
@@ -6,6 +6,13 @@
set_fact:
cluster_ip: "{{ ansible_default_ipv4.address }}"
+- name: Configure etcd (RKE)
+ hosts: kubernetes-etcd
+ roles:
+ - role: rke
+ vars:
+ mode: etcd
+
- name: Configure kubernetes cluster (RKE)
hosts: infrastructure
roles:
diff --git a/ansible/roles/rke/molecule/default/tests/test_infrastructure.py b/ansible/roles/rke/molecule/default/tests/test_infrastructure.py
index 9ba11d6e..731f38bf 100644
--- a/ansible/roles/rke/molecule/default/tests/test_infrastructure.py
+++ b/ansible/roles/rke/molecule/default/tests/test_infrastructure.py
@@ -52,5 +52,5 @@ def test_pods_ready(host):
'metadata']['ownerReferences'][0]['kind'] == 'Job':
continue
assert host.run(
- 'kubectl wait --timeout=120s --for=condition=' + condition + ' -n ' +
+ 'kubectl wait --timeout=240s --for=condition=' + condition + ' -n ' +
namespace + ' pods/' + podname).rc == 0
diff --git a/ansible/roles/rke/molecule/etcd_storage/group_vars b/ansible/roles/rke/molecule/etcd_storage/group_vars
new file mode 120000
index 00000000..e04e088f
--- /dev/null
+++ b/ansible/roles/rke/molecule/etcd_storage/group_vars
@@ -0,0 +1 @@
+../../../../group_vars/ \ No newline at end of file
diff --git a/ansible/roles/rke/molecule/etcd_storage/molecule.yml b/ansible/roles/rke/molecule/etcd_storage/molecule.yml
new file mode 100644
index 00000000..3c915284
--- /dev/null
+++ b/ansible/roles/rke/molecule/etcd_storage/molecule.yml
@@ -0,0 +1,74 @@
+---
+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/kubelet
+ - /var/lib/docker
+ env:
+ container: docker
+ 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
+ env:
+ container: docker
+ volumes:
+ - /var/lib/kubelet
+ - /var/lib/docker
+ groups:
+ - kubernetes
+ - kubernetes-node
+ networks:
+ - name: rke
+ purge_networks: true
+
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ ANSIBLE_LIBRARY: ../../../../library
+ inventory:
+ group_vars:
+ all:
+ rke_etcd:
+ enabled_custom_etcd_storage: false
+ storage_path: /var/lib/etcd-custom
+ storage_mountpoint: /var/lib/rancher/etcd-custom
+ enabled_unsafe_volatile_storage: true
+ tmpfs_size: 5G
+ playbooks:
+ prepare: ../default/prepare.yml
+ converge: ../default/playbook.yml
+ destroy: ../default/destroy.yml
+ options:
+ e: "app_data_path=/opt/onap"
+ lint:
+ name: ansible-lint
+scenario:
+ name: etcd_storage
+verifier:
+ name: testinfra
+ lint:
+ name: flake8