diff --git a/.github/workflows/molecule-test.yaml b/.github/workflows/molecule-test.yaml index edbb92c..4a38917 100644 --- a/.github/workflows/molecule-test.yaml +++ b/.github/workflows/molecule-test.yaml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: ansible: ["2.9", "latest"] - scenario: ["ring", "star"] + scenario: ["ring", "star", "switch"] steps: - uses: actions/checkout@v2 - name: Install dependencies diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 08af734..fb12bde 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -8,3 +8,8 @@ command: "ping -c 1 {{ item }}" with_items: "{{ ansible_play_batch }}" changed_when: false + register: _ping + + - name: Debug + debug: + var: _ping \ No newline at end of file diff --git a/molecule/switch/Dockerfile.j2 b/molecule/switch/Dockerfile.j2 new file mode 120000 index 0000000..867ec5c --- /dev/null +++ b/molecule/switch/Dockerfile.j2 @@ -0,0 +1 @@ +../default/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/switch/converge.yml b/molecule/switch/converge.yml new file mode 120000 index 0000000..73cb8da --- /dev/null +++ b/molecule/switch/converge.yml @@ -0,0 +1 @@ +../default/converge.yml \ No newline at end of file diff --git a/molecule/switch/molecule.yml b/molecule/switch/molecule.yml new file mode 100644 index 0000000..42e48a7 --- /dev/null +++ b/molecule/switch/molecule.yml @@ -0,0 +1,64 @@ +--- +lint: | + set -e + yamllint . + ansible-lint -vv --exclude=.tox +scenario: + name: switch +dependency: + name: galaxy +driver: + name: docker +verifier: + name: ansible +provisioner: + name: ansible + log: True + inventory: + group_vars: + tinc_nodes: + tinc_mode: switch + host_vars: + tinc-switch-1: + tinc_vpn_ip: 10.10.0.15 + tinc-switch-2: + tinc_vpn_ip: 10.10.0.15 + tinc-switch-3: + tinc_vpn_ip: 10.10.0.15 +platforms: + - name: tinc-switch-1 + image: ubuntu-20.04 + privileged: true + command: /lib/systemd/systemd + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + etc_hosts: &etchosts + tinc-switch-1: 10.10.0.11 + tinc-switch-2: 10.10.0.12 + tinc-switch-3: 10.10.0.13 + groups: + - tinc_nodes + - tinc_spine_nodes + - tinc_leaf_nodes + + - name: tinc-switch-2 + image: ubuntu-20.04 + privileged: true + command: /lib/systemd/systemd + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + etc_hosts: *etchosts + groups: + - tinc_nodes + - tinc_leaf_nodes + + - name: tinc-switch-3 + image: ubuntu-20.04 + privileged: true + command: /lib/systemd/systemd + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + etc_hosts: *etchosts + groups: + - tinc_nodes + - tinc_leaf_nodes \ No newline at end of file diff --git a/molecule/switch/verify.yml b/molecule/switch/verify.yml new file mode 120000 index 0000000..15a7868 --- /dev/null +++ b/molecule/switch/verify.yml @@ -0,0 +1 @@ +../default/verify.yml \ No newline at end of file diff --git a/tox.ini b/tox.ini index e9412f3..b1ad91d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.8 -envlist = ansible-{2.9,latest}-{ring,star,openwrt} +envlist = ansible-{2.9,latest}-{ring,star,openwrt,switch} skipsdist = true [testenv] @@ -16,3 +16,4 @@ commands = ring: molecule test [] star: molecule test -s star [] openwrt: molecule test -s openwrt [] + switch: molecule test -s switch []