Add support to Ansible 2.9 (#5361)

This commit is contained in:
Maxime Guyot
2019-12-05 16:24:32 +01:00
committed by Kubernetes Prow Robot
parent 7da2083986
commit b15d41a96a
27 changed files with 58 additions and 57 deletions

View File

@@ -127,7 +127,7 @@
with_items: "{{ hostvars[groups['kube-master'][0]]['kubeadm_init'].stdout_lines | default([]) }}"
when:
- kubeadm_certificate_key is not defined
- item | trim | match('.*--certificate-key.*')
- (item | trim) is match('.*--certificate-key.*')
- name: Create hardcoded kubeadm token for joining nodes with 24h expiration (if defined)
shell: >-

View File

@@ -9,18 +9,18 @@
- Preinstall | restart kube-controller-manager crio/containerd
- Preinstall | restart kube-apiserver docker
- Preinstall | restart kube-apiserver crio/containerd
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
when: not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
- 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 in ["CoreOS", "Container Linux by CoreOS"]
when: ansible_os_family in ["CoreOS", "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 in ["CoreOS", "Container Linux by CoreOS"]
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
- name: Preinstall | reload kubelet
service:

View File

@@ -16,12 +16,14 @@
- name: Stop if unknown OS
assert:
that: ansible_os_family in ['RedHat', 'CentOS', 'Fedora', 'Ubuntu', 'Debian', 'CoreOS', 'Container Linux by CoreOS', 'Suse', 'ClearLinux', 'OracleLinux']
that: ansible_os_family in ['RedHat', 'CentOS', 'Fedora', 'Ubuntu', 'Debian', 'CoreOS', 'Coreos', 'Container Linux by CoreOS', 'Suse', 'ClearLinux', 'OracleLinux']
msg: "{{ ansible_os_family }} is not a known OS"
ignore_errors: "{{ ignore_assert_errors }}"
- name: Stop if unknown network plugin
assert:
that: kube_network_plugin in ['calico', 'canal', 'flannel', 'weave', 'cloud', 'cilium', 'cni', 'contiv', 'kube-ovn', 'kube-router', 'macvlan']
msg: "{{ kube_network_plugin }} is not supported"
when: kube_network_plugin is defined
ignore_errors: "{{ ignore_assert_errors }}"

View File

@@ -18,7 +18,7 @@
- name: Force binaries directory for Container Linux by CoreOS
set_fact:
bin_dir: "/opt/bin"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
tags:
- facts
@@ -85,12 +85,12 @@
{%- if resolvconf|bool -%}/etc/resolvconf/resolv.conf.d/base{%- endif -%}
head: >-
{%- if resolvconf|bool -%}/etc/resolvconf/resolv.conf.d/head{%- endif -%}
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
when: not ansible_os_family in ["CoreOS", "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 in ["CoreOS", "Container Linux by CoreOS"]
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
- name: check if /etc/dhclient.conf exists
stat:

View File

@@ -1,7 +1,7 @@
---
- name: create temporary resolveconf cloud init file
command: cp -f /etc/resolv.conf "{{ resolvconffile }}"
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
- name: Add domain/search/nameservers/options to resolv.conf
blockinfile:
@@ -47,7 +47,7 @@
- name: get temporary resolveconf cloud init file content
command: cat {{ resolvconffile }}
register: cloud_config
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
- name: persist resolvconf cloud init file
template:
@@ -56,4 +56,4 @@
owner: root
mode: 0644
notify: Preinstall | update resolvconf for Container Linux by CoreOS
when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]

View File

@@ -71,7 +71,7 @@
until: pkgs_task_result is succeeded
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS", "ClearLinux"] or is_atomic)
when: not (ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "ClearLinux"] or is_atomic)
tags:
- bootstrap-os

View File

@@ -28,7 +28,7 @@
backup: yes
when:
- disable_ipv6_dns
- not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
tags:
- bootstrap-os

View File

@@ -69,7 +69,7 @@
when:
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
- not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
tags:
- bootstrap-os
- resolvconf
@@ -78,7 +78,7 @@
when:
- dns_mode != 'none'
- resolvconf_mode != 'host_resolvconf'
- not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS"]
tags:
- bootstrap-os
- resolvconf