mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-30 12:42:37 +01:00
Compare commits
3 Commits
983e11322e
...
4c0b1ee8f3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c0b1ee8f3 | ||
|
|
11f9505460 | ||
|
|
850301fbc4 |
2
.github/workflows/cache.yml
vendored
2
.github/workflows/cache.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache Vagrant boxes
|
- name: Cache Vagrant boxes
|
||||||
id: cache-vagrant
|
id: cache-vagrant
|
||||||
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # 4.1.0
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2
|
||||||
with:
|
with:
|
||||||
lookup-only: true #if it exists, we don't need to restore and can skip the next step
|
lookup-only: true #if it exists, we don't need to restore and can skip the next step
|
||||||
path: |
|
path: |
|
||||||
|
|||||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
cache: 'pip' # caching pip dependencies
|
cache: 'pip' # caching pip dependencies
|
||||||
|
|
||||||
- name: Restore Ansible cache
|
- name: Restore Ansible cache
|
||||||
uses: actions/cache/restore@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # 4.1.0
|
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2
|
||||||
with:
|
with:
|
||||||
path: ~/.ansible/collections
|
path: ~/.ansible/collections
|
||||||
key: ansible-${{ hashFiles('collections/requirements.yml') }}
|
key: ansible-${{ hashFiles('collections/requirements.yml') }}
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -65,7 +65,7 @@ jobs:
|
|||||||
cache: 'pip' # caching pip dependencies
|
cache: 'pip' # caching pip dependencies
|
||||||
|
|
||||||
- name: Restore vagrant Boxes cache
|
- name: Restore vagrant Boxes cache
|
||||||
uses: actions/cache/restore@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # 4.1.0
|
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2
|
||||||
with:
|
with:
|
||||||
path: ~/.vagrant.d/boxes
|
path: ~/.vagrant.d/boxes
|
||||||
key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }}
|
key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ kube_vip_bgp_as: "64513"
|
|||||||
kube_vip_bgp_peeraddress: 192.168.30.1
|
kube_vip_bgp_peeraddress: 192.168.30.1
|
||||||
kube_vip_bgp_peeras: "64512"
|
kube_vip_bgp_peeras: "64512"
|
||||||
|
|
||||||
|
kube_vip_bgp_peers: []
|
||||||
|
kube_vip_bgp_peers_groups: ['k3s_master']
|
||||||
|
|
||||||
metal_lb_controller_tag_version: v0.14.3
|
metal_lb_controller_tag_version: v0.14.3
|
||||||
metal_lb_speaker_tag_version: v0.14.3
|
metal_lb_speaker_tag_version: v0.14.3
|
||||||
metal_lb_type: native
|
metal_lb_type: native
|
||||||
|
|||||||
@@ -62,6 +62,14 @@ argument_specs:
|
|||||||
description: Defines the AS for the kube-vip BGP peer
|
description: Defines the AS for the kube-vip BGP peer
|
||||||
default: "64512"
|
default: "64512"
|
||||||
|
|
||||||
|
kube_vip_bgp_peers:
|
||||||
|
description: List of BGP peer ASN & address pairs
|
||||||
|
default: []
|
||||||
|
|
||||||
|
kube_vip_bgp_peers_groups:
|
||||||
|
description: Inventory group in which to search for additional kube_vip_bgp_peers parameters to merge.
|
||||||
|
default: ['k3s_master']
|
||||||
|
|
||||||
kube_vip_iface:
|
kube_vip_iface:
|
||||||
description:
|
description:
|
||||||
- Explicitly define an interface that ALL control nodes
|
- Explicitly define an interface that ALL control nodes
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
- name: Set _kube_vip_bgp_peers fact
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
_kube_vip_bgp_peers: "{{ lookup('community.general.merge_variables', '^kube_vip_bgp_peers__.+$', initial_value=kube_vip_bgp_peers, groups=kube_vip_bgp_peers_groups) }}" # yamllint disable-line rule:line-length
|
||||||
|
|
||||||
- name: Create manifests directory on first master
|
- name: Create manifests directory on first master
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /var/lib/rancher/k3s/server/manifests
|
path: /var/lib/rancher/k3s/server/manifests
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ spec:
|
|||||||
- name: bgp_routerid
|
- name: bgp_routerid
|
||||||
value: "{{ kube_vip_bgp_routerid }}"
|
value: "{{ kube_vip_bgp_routerid }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if _kube_vip_bgp_peers | length > 0 %}
|
||||||
|
- name: bgppeers
|
||||||
|
value: "{{ _kube_vip_bgp_peers | map(attribute='peer_address') | zip(_kube_vip_bgp_peers| map(attribute='peer_asn')) | map('join', ',') | join(':') }}" # yamllint disable-line rule:line-length
|
||||||
|
{% else %}
|
||||||
{% if kube_vip_bgp_as is defined %}
|
{% if kube_vip_bgp_as is defined %}
|
||||||
- name: bgp_as
|
- name: bgp_as
|
||||||
value: "{{ kube_vip_bgp_as }}"
|
value: "{{ kube_vip_bgp_as }}"
|
||||||
@@ -73,6 +77,7 @@ spec:
|
|||||||
- name: bgp_peeras
|
- name: bgp_peeras
|
||||||
value: "{{ kube_vip_bgp_peeras }}"
|
value: "{{ kube_vip_bgp_peeras }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
image: ghcr.io/kube-vip/kube-vip:{{ kube_vip_tag_version }}
|
image: ghcr.io/kube-vip/kube-vip:{{ kube_vip_tag_version }}
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
|
|||||||
@@ -224,7 +224,6 @@
|
|||||||
- name: Set _cilium_bgp_neighbors fact
|
- name: Set _cilium_bgp_neighbors fact
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_cilium_bgp_neighbors: "{{ lookup('community.general.merge_variables', '^cilium_bgp_neighbors__.+$', initial_value=cilium_bgp_neighbors, groups=cilium_bgp_neighbors_groups) }}" # yamllint disable-line rule:line-length
|
_cilium_bgp_neighbors: "{{ lookup('community.general.merge_variables', '^cilium_bgp_neighbors__.+$', initial_value=cilium_bgp_neighbors, groups=cilium_bgp_neighbors_groups) }}" # yamllint disable-line rule:line-length
|
||||||
when: cilium_bgp_neighbors | length > 0
|
|
||||||
|
|
||||||
- name: Copy BGP manifests to first master
|
- name: Copy BGP manifests to first master
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|||||||
Reference in New Issue
Block a user