Skip to content

Commit

Permalink
Weave: when deploying with containerd we need to ensure iptables and …
Browse files Browse the repository at this point in the history
…ipset are in place
  • Loading branch information
cristicalin committed Nov 10, 2021
1 parent a897fd8 commit 0aa6779
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/network_plugin/weave/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ weave_extra_args: ~

# Extra variables for weave_npc that passing to launch.sh, useful for change log level, ex --log-level=error
weave_npc_extra_args: ~

weave_host_packages: []
39 changes: 39 additions & 0 deletions roles/network_plugin/weave/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
---
- name: check if fedora coreos
stat:
path: /run/ostree-booted
get_attributes: no
get_checksum: no
get_mime: no
register: ostree

- name: set is_ostree
set_fact:
is_ostree: "{{ ostree.stat.exists }}"

- name: gather os specific variables
include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}-{{ host_architecture }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml"
- "{{ ansible_distribution|lower }}-{{ host_architecture }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_os_family|lower }}-{{ host_architecture }}.yml"
- "{{ ansible_os_family|lower }}.yml"
- defaults.yml
paths:
- ../vars
skip: true
tags:
- facts

- name: ensure host packages are installed
package:
name: "{{ weave_host_packages }}"
when:
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- not is_ostree
- weave_host_packages|length > 0

- name: Weave | Create manifest
template:
src: weave-net.yml.j2
Expand Down
4 changes: 4 additions & 0 deletions roles/network_plugin/weave/vars/defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
weave_host_packages:
- iptables
- ipset

0 comments on commit 0aa6779

Please sign in to comment.