Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish flannel network info as facts #6

Open
igalic opened this issue Oct 12, 2016 · 0 comments
Open

publish flannel network info as facts #6

igalic opened this issue Oct 12, 2016 · 0 comments

Comments

@igalic
Copy link
Contributor

igalic commented Oct 12, 2016

currently, we deploy this:

file { '/etc/facter/facts.d/flannel.sh':
  ensure  => file,
  mode    => '0700',
  owner   => 'root',
  group   => 'root',
  content => "#!/usr/bin/env bash\n/usr/bin/awk \'{print tolower (\$1)}\' /var/run/flannel/subnet.env",
  require => Class[::flannel]
}

as external fact. This little bash script:

#!/usr/bin/env bash
/usr/bin/awk '{print tolower ($1)}' /var/run/flannel/subnet.env

turns our flannel subnet info:

FLANNEL_NETWORK=172.20.0.0/16
FLANNEL_SUBNET=172.20.9.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true

into facts:

root@minion0-k8s1:~# facter -p | grep flannel_
flannel_ipmasq => true
flannel_mtu => 1450
flannel_network => 172.20.0.0/16
flannel_subnet => 172.20.9.1/24

I think it would be useful to generalize this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant