From ccfa561be0e5fb4c41a622d645bc4663b6f02532 Mon Sep 17 00:00:00 2001 From: Xan Manning Date: Sun, 19 Dec 2021 19:02:31 +0000 Subject: [PATCH] feat(systemd): added molecule tests for #164 --- molecule/autodeploy/converge.yml | 2 ++ molecule/highavailabilitydb/converge.yml | 1 + molecule/highavailabilitydb/prepare.yml | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/molecule/autodeploy/converge.yml b/molecule/autodeploy/converge.yml index 97eb7e9..69df63b 100644 --- a/molecule/autodeploy/converge.yml +++ b/molecule/autodeploy/converge.yml @@ -18,5 +18,7 @@ k3s_server_manifests_urls: - url: https://raw.githubusercontent.com/metallb/metallb/v0.9.6/manifests/namespace.yaml filename: 05-metallb-namespace.yml + k3s_service_env_vars: + GOGC: 10 roles: - role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" diff --git a/molecule/highavailabilitydb/converge.yml b/molecule/highavailabilitydb/converge.yml index 300e903..c61eae5 100644 --- a/molecule/highavailabilitydb/converge.yml +++ b/molecule/highavailabilitydb/converge.yml @@ -10,6 +10,7 @@ datastore-endpoint: "postgres://postgres:verybadpass@database:5432/postgres?sslmode=disable" k3s_agent: snapshotter: native + k3s_service_env_file: /tmp/k3s.env pre_tasks: - name: Set each node to be a control node ansible.builtin.set_fact: diff --git a/molecule/highavailabilitydb/prepare.yml b/molecule/highavailabilitydb/prepare.yml index dade9da..96745a1 100644 --- a/molecule/highavailabilitydb/prepare.yml +++ b/molecule/highavailabilitydb/prepare.yml @@ -37,3 +37,9 @@ ansible.builtin.apt: update_cache: true when: ansible_pkg_mgr == 'apt' + + - name: Ensure environment file exists for k3s_service_env_file + ansible.builtin.lineinfile: + path: /tmp/k3s.env + line: "THISHOST={{ ansible_hostname }}" + mode: 0644