Skip to content

Commit

Permalink
added molecule setup
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-hermann-sva committed Sep 29, 2024
1 parent 3c25cec commit bc9bfcb
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 12 deletions.
27 changes: 15 additions & 12 deletions defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,30 @@ docker_users: [sthings]

# kind
install_kind: true
kind_version: 0.22.0
kind_url: "https://github.com/kubernetes-sigs/kind/releases/download/v{{ kind_version }}/kind-linux-amd64"
kind_version: 0.24.0
kind_cluster_name: kind1
kubectl_version: 1.30.0
kubectl_version: v1.30.2
kind_api_port: 6443
kind_server: 127.0.0.1

bin:
kubectl:
bin_name: kubectl
bin_name: "kubectl"
bin_version: "{{ kubectl_version }}"
source_url: "https://dl.k8s.io/v{{ kubectl_version }}/kubernetes-client-linux-amd64.tar.gz"
bin_to_copy: "kubernetes/client/bin/kubectl"
bin_dir: /usr/bin/
to_remove: kubernetes
check_bin_version_before_installing: true
source_url: "https://dl.k8s.io/{{ kubectl_version }}/bin/linux/amd64/kubectl"
bin_to_copy: "kubectl"
to_remove: "kubectl"
bin_dir: "/usr/local/bin"
version_cmd: " version --client"
target_version: "{{ kubectl_version }}"
kind:
bin_name: "kind"
bin_name: kind
bin_version: "{{ kind_version }}"
check_bin_version_before_installing: true
source_url: "https://github.com/kubernetes-sigs/kind/releases/download/v{{ kind_version }}/kind-linux-amd64"

Check warning on line 65 in defaults/main.yaml

View workflow job for this annotation

GitHub Actions / Lint yaml files / Yaml-Lint

65:111 [line-length] line too long (112 > 110 characters)
bin_to_copy: kind-linux-amd64
bin_dir: /usr/bin/
to_remove: kind-linux-amd64
check_bin_version_before_installing: true
to_remove: ""
bin_dir: "/usr/bin/kind"
version_cmd: "version"
target_version: "{{ kind_version }}"
11 changes: 11 additions & 0 deletions molecule/docker_test/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- hosts: all #"{{ target_host }}"
become: true

vars:
docker_install_compose: true
docker_version: '' # leave empty for latest version or set e.g. '=5:23.0.6-1~ubuntu.23.04~lunar'
install_kind: false

roles:
- install-configure-docker
39 changes: 39 additions & 0 deletions molecule/docker_test/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
role_name_check: 1
dependency:
name: galaxy
options:
ignore-errors: true
driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux9}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
name: ansible
playbooks:
converge: ${MOLECULE_PLAYBOOK:-converge.yml}

verifier:
name: ansible

scenario:
name: docker_test
test_sequence:
- destroy
- dependency
- syntax
- create
- prepare
- converge
#- idempotence
#- check
# - side_effect
# - verify
# - destroy

0 comments on commit bc9bfcb

Please sign in to comment.