Added node-cleanup task of rke2 role
Change-Id: I866180e612da9b75b9c062c62326d236aec82ce2
diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml
new file mode 100644
index 0000000..7cb031d
--- /dev/null
+++ b/molecule/default/prepare.yml
@@ -0,0 +1,60 @@
+---
+# rke2 molecule/default/prepare.yml
+#
+# SPDX-FileCopyrightText: © 2022 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Prepare
+ hosts: all
+ become: true
+ vars:
+ pre_tasks:
+ - name: Install docker
+ include_role:
+ name: docker
+
+ - name: Install required system packages
+ apt: name={{ item }} state=present update_cache=yes
+ loop: ['python3-pip', 'python3-setuptools']
+
+ - name: Install required pip packages
+ pip:
+ name: docker
+ state: present
+
+ - name: Create directory
+ file:
+ path: "{{ item }}"
+ state: directory
+ mode: 0644
+ with_items:
+ - /etc/ceph
+ - /etc/cni
+ - /etc/kubernetes
+ - /opt/cni
+ - /opt/rke
+ - /run/secrets/kubernetes.io
+ - /run/calico
+ - /run/flannel
+ - /var/lib/calico
+ - /var/lib/etcd
+ - /var/lib/cni
+ - /var/lib/kubelet
+ - /var/lib/rancher/rke/log
+ - /var/log/containers
+ - /var/log/pods
+ - /var/run/calico
+
+ - name: Start simple docker container
+ docker_container:
+ name: nginx
+ image: nginx
+ state: present
+ pull: true
+ restart_policy: always
+ mounts:
+ - type: tmpfs
+ target: /var/lib/kubelet
+ read_only: false
+ volumes:
+ - /opt/rke