Better fix for different CoreOS os family facts

Signed-off-by: Bogdan Dobrelya <bogdando@mail.ru>
This commit is contained in:
Bogdan Dobrelya
2017-01-05 16:32:08 +01:00
parent c0400e9db5
commit 5af2c42bde
17 changed files with 35 additions and 35 deletions

View File

@@ -3,7 +3,7 @@
notify:
- Preinstall | reload network
- Preinstall | reload kubelet
when: ansible_os_family != "Container Linux by CoreOS"
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
# FIXME(bogdando) https://github.com/projectcalico/felix/issues/1185
- name: Preinstall | reload network
@@ -15,18 +15,18 @@
networking
{%- endif %}
state: restarted
when: ansible_os_family != "Container Linux by CoreOS" and kube_network_plugin not in ['canal', 'calico']
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] and kube_network_plugin not in ['canal', 'calico']
- name: Preinstall | update resolvconf for Container Linux by CoreOS
command: /bin/true
notify:
- Preinstall | apply resolvconf cloud-init
- Preinstall | reload kubelet
when: ansible_os_family == "Container Linux by CoreOS"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- name: Preinstall | apply resolvconf cloud-init
command: /usr/bin/coreos-cloudinit --from-file {{ resolveconf_cloud_init_conf }}
when: ansible_os_family == "Container Linux by CoreOS"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- name: Preinstall | reload kubelet
service:

View File

@@ -5,7 +5,7 @@
- name: Force binaries directory for Container Linux by CoreOS
set_fact:
bin_dir: "/opt/bin"
when: ansible_os_family == "Container Linux by CoreOS"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
tags: facts
- name: check bin dir exists
@@ -131,7 +131,7 @@
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
with_items: "{{required_pkgs | default([]) | union(common_required_pkgs|default([]))}}"
when: ansible_os_family != "Container Linux by CoreOS"
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
tags: bootstrap-os
- name: Disable IPv6 DNS lookup
@@ -140,7 +140,7 @@
line: "precedence ::ffff:0:0/96 100"
state: present
backup: yes
when: disable_ipv6_dns and ansible_os_family != "Container Linux by CoreOS"
when: disable_ipv6_dns and not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
tags: bootstrap-os
# Todo : selinux configuration

View File

@@ -1,7 +1,7 @@
---
- name: create temporary resolveconf cloud init file
command: cp -f /etc/resolv.conf "{{ resolvconffile }}"
when: ansible_os_family == "Container Linux by CoreOS"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- name: Remove search/domain/nameserver options
lineinfile:
@@ -48,7 +48,7 @@
- name: get temporary resolveconf cloud init file content
command: cat {{ resolvconffile }}
register: cloud_config
when: ansible_os_family == "Container Linux by CoreOS"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- name: persist resolvconf cloud init file
template:
@@ -57,8 +57,8 @@
owner: root
mode: 0644
notify: Preinstall | update resolvconf for Container Linux by CoreOS
when: ansible_os_family == "Container Linux by CoreOS"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- include: dhclient-hooks.yml
when: ansible_os_family != "Container Linux by CoreOS"
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
tags: [bootstrap-os, resolvconf]

View File

@@ -35,11 +35,11 @@
{%- if resolvconf|bool -%}/etc/resolvconf/resolv.conf.d/base{%- endif -%}
head: >-
{%- if resolvconf|bool -%}/etc/resolvconf/resolv.conf.d/head{%- endif -%}
when: ansible_os_family != "Container Linux by CoreOS"
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- name: target temporary resolvconf cloud init file (Container Linux by CoreOS)
set_fact: resolvconffile=/tmp/resolveconf_cloud_init_conf
when: ansible_os_family == "Container Linux by CoreOS"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- name: target dhclient conf/hook files for Red Hat family
set_fact:

View File

@@ -74,7 +74,7 @@
/usr/local/share/ca-certificates/kube-ca.crt
{%- elif ansible_os_family == "RedHat" -%}
/etc/pki/ca-trust/source/anchors/kube-ca.crt
{%- elif ansible_os_family == "Container Linux by CoreOS" -%}
{%- elif ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] -%}
/etc/ssl/certs/kube-ca.pem
{%- endif %}
tags: facts