From 19268ded234099e340d04b6b9376c7a5e37f0d50 Mon Sep 17 00:00:00 2001 From: Antoine Legrand <2t.antoine@gmail.com> Date: Tue, 21 Aug 2018 17:53:23 +0200 Subject: [PATCH] Fix some arm64 errors --- roles/dnsmasq/defaults/main.yml | 3 -- roles/docker/tasks/main.yml | 3 +- roles/docker/vars/ubuntu.yml | 47 ------------------------- roles/download/defaults/main.yml | 9 +++-- roles/etcd/templates/etcd-events.env.j2 | 4 +++ roles/etcd/templates/etcd.env.j2 | 4 +++ roles/etcd/templates/etcd.j2 | 3 -- 7 files changed, 16 insertions(+), 57 deletions(-) delete mode 100644 roles/docker/vars/ubuntu.yml diff --git a/roles/dnsmasq/defaults/main.yml b/roles/dnsmasq/defaults/main.yml index e3013f4ea..15fb7f169 100644 --- a/roles/dnsmasq/defaults/main.yml +++ b/roles/dnsmasq/defaults/main.yml @@ -33,6 +33,3 @@ dnsmasq_min_replicas: 1 # Custom name servers dnsmasq_upstream_dns_servers: [] - -# Arch of Docker images and needed packages -image_arch: amd64 diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 70e98b53f..0eb0102d9 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -6,8 +6,9 @@ - "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml" - "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.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 }}-{{ ansible_architecture }}.yml" + - "{{ ansible_os_family|lower }}-{{ host_architecture }}.yml" - "{{ ansible_os_family|lower }}.yml" - defaults.yml paths: diff --git a/roles/docker/vars/ubuntu.yml b/roles/docker/vars/ubuntu.yml deleted file mode 100644 index cab1c0824..000000000 --- a/roles/docker/vars/ubuntu.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -docker_kernel_min_version: '3.10' - -# https://download.docker.com/linux/ubuntu/ -docker_versioned_pkg: - 'latest': docker-ce - '1.11': docker-engine=1.11.2-0~{{ ansible_distribution_release|lower }} - '1.12': docker-engine=1.12.6-0~ubuntu-{{ ansible_distribution_release|lower }} - '1.13': docker-engine=1.13.1-0~ubuntu-{{ ansible_distribution_release|lower }} - '17.03': docker-ce=17.03.2~ce-0~ubuntu-{{ ansible_distribution_release|lower }} - '17.09': docker-ce=17.09.0~ce-0~ubuntu-{{ ansible_distribution_release|lower }} - 'stable': docker-ce=17.03.2~ce-0~ubuntu-{{ ansible_distribution_release|lower }} - 'edge': docker-ce=17.12.1~ce-0~ubuntu-{{ ansible_distribution_release|lower }} - -docker_package_info: - pkg_mgr: apt - pkgs: - - name: "{{ docker_versioned_pkg[docker_version | string] }}" - force: yes - -docker_repo_key_info: - pkg_key: apt_key - url: '{{ docker_ubuntu_repo_gpgkey }}' - repo_keys: - - 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 - -docker_repo_info: - pkg_repo: apt_repository - repos: - - > - deb {{ docker_ubuntu_repo_base_url }} - {{ ansible_distribution_release|lower }} - stable - -dockerproject_repo_key_info: - pkg_key: apt_key - url: '{{ dockerproject_apt_repo_gpgkey }}' - repo_keys: - - 58118E89F3A912897C070ADBF76221572C52609D - -dockerproject_repo_info: - pkg_repo: apt_repository - repos: - - > - deb {{ dockerproject_apt_repo_base_url }} - {{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }} - main diff --git a/roles/download/defaults/main.yml b/roles/download/defaults/main.yml index 2a1d71193..c84392352 100644 --- a/roles/download/defaults/main.yml +++ b/roles/download/defaults/main.yml @@ -108,9 +108,12 @@ dnsmasq_image_tag: "{{ dnsmasq_version }}" kubedns_version: 1.14.10 kubedns_image_repo: "gcr.io/google_containers/k8s-dns-kube-dns-{{ image_arch }}" kubedns_image_tag: "{{ kubedns_version }}" -coredns_version: 1.2.0 -coredns_image_repo: "docker.io/coredns/coredns" -coredns_image_tag: "{{ coredns_version }}" + +coredns_version: "{%- if image_arch != 'amd64' -%}1.1.3{%- else -%}1.2.0{%- endif %}" +coredns_image_repo: "gcr.io/google-containers/coredns" +coredns_image_tag: "{{ coredns_version }}{%- if image_arch != 'amd64' -%}__{{ image_arch}}_linux{%- endif %}" + + dnsmasq_nanny_image_repo: "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-{{ image_arch }}" dnsmasq_nanny_image_tag: "{{ kubedns_version }}" dnsmasq_sidecar_image_repo: "gcr.io/google_containers/k8s-dns-sidecar-{{ image_arch }}" diff --git a/roles/etcd/templates/etcd-events.env.j2 b/roles/etcd/templates/etcd-events.env.j2 index 525ce86c3..111329d05 100644 --- a/roles/etcd/templates/etcd-events.env.j2 +++ b/roles/etcd/templates/etcd-events.env.j2 @@ -30,3 +30,7 @@ ETCD_PEER_TRUSTED_CA_FILE={{ etcd_cert_dir }}/ca.pem ETCD_PEER_CERT_FILE={{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem ETCD_PEER_KEY_FILE={{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem ETCD_PEER_CLIENT_CERT_AUTH={{ etcd_peer_client_auth }} + +{% if ansible_architecture == "aarch64" -%} +ETCD_UNSUPPORTED_ARCH=arm64 +{%- endif %} diff --git a/roles/etcd/templates/etcd.env.j2 b/roles/etcd/templates/etcd.env.j2 index c302b0285..6ef0cfa8c 100644 --- a/roles/etcd/templates/etcd.env.j2 +++ b/roles/etcd/templates/etcd.env.j2 @@ -35,3 +35,7 @@ ETCD_PEER_CLIENT_CERT_AUTH={{ etcd_peer_client_auth }} {% for key, value in etcd_extra_vars.items() %} {{ key }}={{ value }} {% endfor %} + +{% if ansible_architecture == "aarch64" -%} +ETCD_UNSUPPORTED_ARCH=arm64 +{%- endif %} diff --git a/roles/etcd/templates/etcd.j2 b/roles/etcd/templates/etcd.j2 index bd830e403..a6628d8fb 100755 --- a/roles/etcd/templates/etcd.j2 +++ b/roles/etcd/templates/etcd.j2 @@ -3,9 +3,6 @@ --restart=on-failure:5 \ --env-file=/etc/etcd.env \ --net=host \ - {% if ansible_architecture == "aarch64" -%} - -e ETCD_UNSUPPORTED_ARCH=arm64 \ - {%- endif %} -v /etc/ssl/certs:/etc/ssl/certs:ro \ -v {{ etcd_cert_dir }}:{{ etcd_cert_dir }}:ro \ -v {{ etcd_data_dir }}:{{ etcd_data_dir }}:rw \