Use ansible roles to setup development tools 17/33517/3
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Wed, 19 Apr 2017 06:52:55 +0000 (14:52 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Thu, 20 Apr 2017 03:33:38 +0000 (11:33 +0800)
Change-Id: I897773edf8dcacf08e67fa3eb999c4c10ba22805
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
resources/metric/nDPI.yaml
resources/roles/development-tools/tasks/main.yml [new file with mode: 0644]
tests/integration/roles [new symlink]
tests/integration/run.yaml

index 41bedc3..b3e7259 100644 (file)
   run_once: yes
   delegate_to: localhost
 
-- name: installing nDPI dependencies if CentOS
-  yum:
-    name: '{{ item }}'
-    state: present
-  when: ansible_os_family == "RedHat"
-  with_items:
-    - git
-    - gcc
-    - patch
-    - perl-Time-HiRes
-    - autofconf
-    - automake
-    - libpcap-devel libtool
-
-- name: installing nDPI dependencies if Ubuntu
-  apt:
-    name: build-essential
-    state: present
-  when: ansible_os_family == "Debian"
-
 - name: making nDPI temporary directory
   file:
     path: "{{ nDPI_cwd }}"
diff --git a/resources/roles/development-tools/tasks/main.yml b/resources/roles/development-tools/tasks/main.yml
new file mode 100644 (file)
index 0000000..5fcb19d
--- /dev/null
@@ -0,0 +1,23 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+- name: install development tools for Debian family
+  package:
+    name: build-essential
+    state: present
+  when: ansible_os_family == "Debian"
+
+- name: install development tools for RedHat family
+  yum:
+    name: '{{ item }}'
+    state: present
+  when: ansible_os_family == "RedHat"
+  with_items:
+    - "@Development tools"
+    - gcc-c++
diff --git a/tests/integration/roles b/tests/integration/roles
new file mode 120000 (symlink)
index 0000000..a2363ee
--- /dev/null
@@ -0,0 +1 @@
+../../resources/roles
\ No newline at end of file
index 5c74a47..bab88d7 100644 (file)
   tasks:
   - name: check ssh connection
     ping:
+  tags: [setup]
+
+- hosts: compute
+  roles:
+    - development-tools
+  tags: [setup]
+
+- hosts: compute
+  tasks:
   - name: collect system information
     include: "{{ qtip_resources }}/metric/inxi.yaml"
   - name: ssl metrics