forked from techno-tim/k3s-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test single-node cluster (techno-tim#78)
* Molecule: Derive overrides.yml location from scenario dir # Conflicts: # molecule/default/molecule.yml # molecule/ipv6/molecule.yml * Molecule: Add single_node scenario * Fix get_nodes test for the case of empty groups
- Loading branch information
Showing
8 changed files
with
80 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ jobs: | |
matrix: | ||
scenario: | ||
- default | ||
- single_node | ||
fail-fast: false | ||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
- name: Apply overrides | ||
ansible.builtin.import_playbook: >- | ||
{{ lookup("ansible.builtin.env", "OVERRIDES_FILE") }} | ||
{{ lookup("ansible.builtin.env", "MOLECULE_SCENARIO_DIRECTORY") }}/overrides.yml | ||
- name: Converge | ||
ansible.builtin.import_playbook: ../../site.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
- name: Apply overrides | ||
ansible.builtin.import_playbook: >- | ||
{{ lookup("ansible.builtin.env", "OVERRIDES_FILE") }} | ||
{{ lookup("ansible.builtin.env", "MOLECULE_SCENARIO_DIRECTORY") }}/overrides.yml | ||
- name: Reset | ||
ansible.builtin.import_playbook: ../../reset.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: vagrant | ||
platforms: | ||
- name: control1 | ||
box: generic/ubuntu2204 | ||
memory: 4096 | ||
cpus: 4 | ||
config_options: | ||
# We currently can not use public-key based authentication on Ubuntu 22.04, | ||
# see: https://github.com/chef/bento/issues/1405 | ||
ssh.username: "vagrant" | ||
ssh.password: "vagrant" | ||
groups: | ||
- k3s_cluster | ||
- master | ||
interfaces: | ||
- network_name: private_network | ||
ip: 192.168.30.50 | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
converge: ../resources/converge.yml | ||
side_effect: ../resources/reset.yml | ||
verify: ../resources/verify.yml | ||
inventory: | ||
links: | ||
group_vars: ../../inventory/sample/group_vars | ||
scenario: | ||
test_sequence: | ||
- dependency | ||
- lint | ||
- cleanup | ||
- destroy | ||
- syntax | ||
- create | ||
- prepare | ||
- converge | ||
# idempotence is not possible with the playbook in its current form. | ||
- verify | ||
# We are repurposing side_effect here to test the reset playbook. | ||
# This is why we do not run it before verify (which tests the cluster), | ||
# but after the verify step. | ||
- side_effect | ||
- cleanup | ||
- destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Apply overrides | ||
hosts: all | ||
tasks: | ||
- name: Override host variables | ||
ansible.builtin.set_fact: | ||
# See: https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant # noqa yaml[line-length] | ||
flannel_iface: eth1 | ||
|
||
# The test VMs might be a bit slow, so we give them more time to join the cluster: | ||
retry_count: 45 | ||
|
||
# Make sure that our IP ranges do not collide with those of the default scenario | ||
apiserver_endpoint: "192.168.30.223" | ||
metal_lb_ip_range: "192.168.30.91-192.168.30.99" |