From 728155a2a15238599b0f8454aae0db7a9a298d7b Mon Sep 17 00:00:00 2001 From: Jeff Bornemann Date: Fri, 12 Jul 2019 02:17:06 -0400 Subject: [PATCH] Support for Oracle Linux (#3655) Fixed Issue #1032 test case for OEL7 AIL with kubeadm Add packet CI stuff for oracle 7 --- .gitlab-ci/gce.yml | 7 +++++++ .gitlab-ci/packet.yml | 5 +++++ README.md | 1 + Vagrantfile | 1 + roles/bootstrap-os/tasks/bootstrap-oracle.yml | 21 +++++++++++++++++++ roles/bootstrap-os/tasks/main.yml | 3 +++ roles/container-engine/cri-o/tasks/main.yaml | 2 +- roles/container-engine/docker/tasks/main.yml | 8 +++---- .../preinstall/tasks/0020-verify-settings.yml | 2 +- roles/kubernetes/preinstall/tasks/main.yml | 2 +- .../roles/kubevirt-images/defaults/main.yml | 6 ++++++ .../roles/packet-ci/defaults/main.yml | 1 + tests/files/gce_oracle-canal.yml | 14 +++++++++++++ tests/files/packet_oracle-7-canal.yml | 11 ++++++++++ 14 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 roles/bootstrap-os/tasks/bootstrap-oracle.yml create mode 100644 tests/files/gce_oracle-canal.yml create mode 100644 tests/files/packet_oracle-7-canal.yml diff --git a/.gitlab-ci/gce.yml b/.gitlab-ci/gce.yml index 9268b211d..f8ad8073f 100644 --- a/.gitlab-ci/gce.yml +++ b/.gitlab-ci/gce.yml @@ -218,6 +218,13 @@ gce_centos7-multus-calico: <<: *centos7_multus_calico_variables when: manual +gce_oracle-canal: + stage: deploy-gce + <<: *gce + when: manual + except: ['triggers'] + only: ['master', /^pr-.*$/] + gce_opensuse-canal: stage: deploy-gce <<: *gce diff --git a/.gitlab-ci/packet.yml b/.gitlab-ci/packet.yml index 9a7da6956..62ee62128 100644 --- a/.gitlab-ci/packet.yml +++ b/.gitlab-ci/packet.yml @@ -101,6 +101,11 @@ packet_opensuse-canal: <<: *packet when: manual +packet_oracle-7-canal: + stage: deploy-part2 + <<: *packet + when: manual + packet_ubuntu-kube-router-sep: stage: deploy-part2 <<: *packet diff --git a/README.md b/README.md index c3714ed9a..bc6b63ef5 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ Supported Linux Distributions - **Fedora** 28 - **Fedora/CentOS** Atomic - **openSUSE** Leap 42.3/Tumbleweed +- **Oracle Linux** 7 Note: Upstart/SysV init based OS types are not supported. diff --git a/Vagrantfile b/Vagrantfile index 991ab2a0f..88a55ed89 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -25,6 +25,7 @@ SUPPORTED_OS = { "fedora" => {box: "fedora/28-cloud-base", user: "vagrant"}, "opensuse" => {box: "opensuse/openSUSE-15.0-x86_64", user: "vagrant"}, "opensuse-tumbleweed" => {box: "opensuse/openSUSE-Tumbleweed-x86_64", user: "vagrant"}, + "oraclelinux" => {box: "generic/oracle7", user: "vagrant"}, } # Defaults for config options defined in CONFIG diff --git a/roles/bootstrap-os/tasks/bootstrap-oracle.yml b/roles/bootstrap-os/tasks/bootstrap-oracle.yml new file mode 100644 index 000000000..5e1126e47 --- /dev/null +++ b/roles/bootstrap-os/tasks/bootstrap-oracle.yml @@ -0,0 +1,21 @@ +--- +- name: Download Oracle Linux public yum repo + get_url: + url: https://yum.oracle.com/public-yum-ol7.repo + dest: /etc/yum.repos.d/public-yum-ol7.repo + +- name: Enable Oracle Linux repo + ini_file: + dest: /etc/yum.repos.d/public-yum-ol7.repo + section: "{{ item }}" + option: enabled + value: "1" + with_items: + - ol7_latest + - ol7_addons + - ol7_developer_EPEL + +- name: Install packages requirements for bootstrap + yum: + name: container-selinux + state: present diff --git a/roles/bootstrap-os/tasks/main.yml b/roles/bootstrap-os/tasks/main.yml index e758fca12..292017446 100644 --- a/roles/bootstrap-os/tasks/main.yml +++ b/roles/bootstrap-os/tasks/main.yml @@ -25,6 +25,9 @@ - include_tasks: bootstrap-opensuse.yml when: '"openSUSE" in os_release.stdout' +- include_tasks: bootstrap-oracle.yml + when: '"Oracle" in os_release.stdout' + - name: Create remote_tmp for it is used by another module file: path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}" diff --git a/roles/container-engine/cri-o/tasks/main.yaml b/roles/container-engine/cri-o/tasks/main.yaml index 82767a8b9..9ab834a2b 100644 --- a/roles/container-engine/cri-o/tasks/main.yaml +++ b/roles/container-engine/cri-o/tasks/main.yaml @@ -22,7 +22,7 @@ description: OpenShift Origin Repo baseurl: "{{ crio_rhel_repo_base_url }}" gpgcheck: no - when: ansible_distribution in ["CentOS","RedHat"] and not is_atomic + when: ansible_distribution in ["CentOS","RedHat","OracleLinux"] and not is_atomic - name: Add CRI-O PPA apt_repository: diff --git a/roles/container-engine/docker/tasks/main.yml b/roles/container-engine/docker/tasks/main.yml index e44dca8d6..cb1f82ce9 100644 --- a/roles/container-engine/docker/tasks/main.yml +++ b/roles/container-engine/docker/tasks/main.yml @@ -104,11 +104,11 @@ dest: "{{ yum_repo_dir }}/docker.repo" when: ansible_distribution == "Fedora" and not is_atomic -- name: Configure docker repository on RedHat/CentOS +- name: Configure docker repository on RedHat/CentOS/Oracle Linux template: src: "rh_docker.repo.j2" dest: "{{ yum_repo_dir }}/docker.repo" - when: ansible_distribution in ["CentOS","RedHat"] and not is_atomic + when: ansible_distribution in ["CentOS","RedHat","OracleLinux"] and not is_atomic - name: check if container-selinux is available yum: @@ -136,7 +136,7 @@ src: "{{ yum_conf }}" dest: "{{ docker_yum_conf }}" remote_src: yes - when: ansible_distribution in ["CentOS","RedHat"] and not is_atomic + when: ansible_distribution in ["CentOS","RedHat","OracleLinux"] and not is_atomic - name: Edit copy of yum.conf to set obsoletes=0 lineinfile: @@ -144,7 +144,7 @@ state: present regexp: '^obsoletes=' line: 'obsoletes=0' - when: ansible_distribution in ["CentOS","RedHat"] and not is_atomic + when: ansible_distribution in ["CentOS","RedHat","OracleLinux"] and not is_atomic - name: ensure docker packages are installed action: "{{ docker_package_info.pkg_mgr }}" diff --git a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml index 8153bfc85..d5b139e2b 100644 --- a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml @@ -16,7 +16,7 @@ - name: Stop if unknown OS assert: - that: ansible_os_family in ['RedHat', 'CentOS', 'Fedora', 'Ubuntu', 'Debian', 'CoreOS', 'Container Linux by CoreOS', 'Suse', 'ClearLinux'] + that: ansible_os_family in ['RedHat', 'CentOS', 'Fedora', 'Ubuntu', 'Debian', 'CoreOS', 'Container Linux by CoreOS', 'Suse', 'ClearLinux', 'OracleLinux'] ignore_errors: "{{ ignore_assert_errors }}" - name: Stop if unknown network plugin diff --git a/roles/kubernetes/preinstall/tasks/main.yml b/roles/kubernetes/preinstall/tasks/main.yml index e9e2f6420..63d20a923 100644 --- a/roles/kubernetes/preinstall/tasks/main.yml +++ b/roles/kubernetes/preinstall/tasks/main.yml @@ -90,6 +90,6 @@ when: - not dns_late - azure_check.stat.exists - - ansible_distribution in ["CentOS","RedHat"] + - ansible_distribution in ["CentOS","RedHat","OracleLinux"] tags: - bootstrap-os diff --git a/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml b/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml index ed3407a93..4916ef311 100644 --- a/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml +++ b/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml @@ -35,3 +35,9 @@ images: url: https://cdimage.debian.org/cdimage/openstack/current-9/debian-9-openstack-amd64.qcow2 checksum: sha256:01d9345ba7a6523d214d2eaabe07fe7b4b69b28e63d7a6b322521e99e5768719 converted: true + + oracle-7: + filename: oracle-linux-76.qcow2 + url: https://storage.googleapis.com/born-images/oracle76/oracle-linux-76.qcow2 + checksum: sha256:f396c03e907fa2a0c94d6807b9f62622f23ee3499df4456ae2a15da381fbdca5 + converted: true diff --git a/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml b/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml index 5893be751..7093a960d 100644 --- a/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml +++ b/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml @@ -26,3 +26,4 @@ cloud_init: rhel-server-7: "I2Nsb3VkLWNvbmZpZwpzeXN0ZW1faW5mbzoKICBkaXN0cm86IHJoZWwKdXNlcnM6CiAtIG5hbWU6IGt1YmVzcHJheQogICBncm91cHM6IHdoZWVsCiAgIHN1ZG86ICdBTEw9KEFMTCkgTk9QQVNTV0Q6QUxMJwogICBzaGVsbDogL2Jpbi9iYXNoCiAgIGxvY2tfcGFzc3dkOiBGYWxzZQogICBob21lOiAvaG9tZS9rdWJlc3ByYXkKICAgc3NoX2F1dGhvcml6ZWRfa2V5czoKICAgICAtIHNzaC1yc2EgQUFBQUIzTnphQzF5YzJFQUFBQURBUUFCQUFBQkFRQ2FuVGkvZUt4MCt0SFlKQWVEaHErc0ZTMk9iVVAxL0k2OWY3aVYzVXRrS2xUMjBKZlcxZjZGZVh0LzA0VmYyN1dRcStOcXM2dkdCcUQ5UVhTWXVmK3QwL3M3RVBMalRlaTltZTFtcHFyK3VUZStLRHRUUDM5cGZEMy9lVkNhZUI3MjZHUDJGa2FEMEZ6cG1FYjY2TzNOcWh4T1E5Nkd4LzlYVHV3L0szbGxqNE9WRDZHcmpSM0I3YzRYdEVCc1pjWnBwTUovb0gxbUd5R1hkaDMxbVdRU3FBUk8vUDhVOEd3dDArSEdwVXdoL2hkeTN0K1NZb1RCMkd3VmIwem95Vnd0VnZmRFF6c204ZnEzYXY0S3ZlejhrWXVOREp2MDV4NGx2VVpnUjE1WkRSWHNBbmRoUXlxb1hkQ0xBZTArZWFLWHE5QmtXeEtGYjloUGUwQVVqamE1Cgo=" ubuntu-1604: "I2Nsb3VkLWNvbmZpZwogdXNlcnM6CiAgLSBuYW1lOiBrdWJlc3ByYXkKICAgIHN1ZG86IEFMTD0oQUxMKSBOT1BBU1NXRDpBTEwKICAgIHNoZWxsOiAvYmluL2Jhc2gK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MTVaRFJYc0FuZGhReXFvWGRDTEFlMCtlYUtYcTlCa1d4S0ZiOWhQZTBBVWpqYTU=" diff --git a/tests/files/gce_oracle-canal.yml b/tests/files/gce_oracle-canal.yml new file mode 100644 index 000000000..f3da8a1a5 --- /dev/null +++ b/tests/files/gce_oracle-canal.yml @@ -0,0 +1,14 @@ +--- +# Instance settings +cloud_image_family: oracle-7 +cloud_region: us-central1-a +cloud_machine_type: "n1-standard-1" +mode: default + +# Deployment settings +kube_network_plugin: canal +dynamic_kubelet_configuration: true +deploy_netchecker: true +kubeadm_enabled: true +kubedns_min_replicas: 1 +cloud_provider: gce diff --git a/tests/files/packet_oracle-7-canal.yml b/tests/files/packet_oracle-7-canal.yml new file mode 100644 index 000000000..042507d1a --- /dev/null +++ b/tests/files/packet_oracle-7-canal.yml @@ -0,0 +1,11 @@ +--- +# Instance settings +cloud_image: oracle-7 +mode: ha + +# Kubespray settings +kube_network_plugin: canal +kubeadm_enabled: true +dynamic_kubelet_configuration: true +deploy_netchecker: true +dns_min_replicas: 1