XCI: k8s: Add support for CentOS distro 07/51607/10
authorwutianwei <wutianwei1@huawei.com>
Sat, 3 Feb 2018 08:53:28 +0000 (16:53 +0800)
committerwutianwei <wutianwei1@huawei.com>
Fri, 23 Feb 2018 02:09:48 +0000 (02:09 +0000)
Kubespray already supports the CentOS distribution so make the
necessary changes to allow it to work in XCI.

Change-Id: I3cf1db055a5fd563b107b46456bc3e18eeafb3ab
Co-authored-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: wutianwei <wutianwei1@huawei.com>
xci/installer/kubespray/playbooks/configure-opnfvhost.yml
xci/installer/kubespray/playbooks/configure-targethosts.yml
xci/installer/kubespray/playbooks/group_vars/all
xci/opnfv-scenario-requirements.yml

index 23f9385..9fb4da1 100644 (file)
     - name: copy k8s_cluster.yml
       shell: "cp -rf {{ remote_xci_path }}/xci/installer/kubespray/files/k8s-cluster.yml \
                      {{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory/group_vars"
-    - name: install dbus and ptyhon-netaddr
-      apt:
-        name: "{{item}}"
-        update_cache: yes
-      with_items: "{{ kube_require_packages }}"
+    - name: Install required packages
+      package:
+        name: "{{ kube_require_packages[ansible_pkg_mgr] }}"
+        state: present
+        update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
       when: XCI_FLAVOR == 'aio'
     - name: pip install ansible
       pip:
index 7e29025..08c735b 100644 (file)
@@ -6,11 +6,11 @@
       copy:
         src: "{{ XCI_PATH }}/xci/files/authorized_keys"
         dest: /root/.ssh/authorized_keys
-    - name: install dbus and ptyhon-netaddr
-      apt:
-        name: "{{item}}"
-        update_cache: yes
-      with_items: "{{ kube_require_packages }}"
+    - name: Install required packages
+      package:
+        name: "{{ kube_require_packages[ansible_pkg_mgr] }}"
+        state: present
+        update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
 
 - hosts: kube-master
   remote_user: root
index d2c36bf..87ed63b 100644 (file)
@@ -1,6 +1,13 @@
 kube_require_packages:
-  - "python-netaddr"
-  - "dbus"
+  apt:
+    - python-netaddr
+    - dbus
+  yum:
+    - python-netaddr
+    - dbus
+  zypper:
+    - python-netaddr
+    - dbus-1
 
 keepalived_ubuntu_src: "uca"
 keepalived_uca_apt_repo_url: "{{ uca_apt_repo_url | default('http://ubuntu-cloud.archive.canonical.com/ubuntu') }}"
index ece4cae..36415d3 100644 (file)
@@ -71,3 +71,4 @@
         - noha
       distros:
         - ubuntu
+        - centos