ansible: Add compilers to amd64 nodes
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 23 Apr 2019 21:47:50 +0000 (17:47 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Tue, 23 Apr 2019 21:47:50 +0000 (17:47 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
automation/ansible/node-all.yml
automation/ansible/node-amd64.yml
automation/ansible/roles/compilers/tasks/main.yml [new file with mode: 0644]
automation/ansible/roles/compilers/tasks/setup-Alpine.yml [new file with mode: 0644]
automation/ansible/roles/compilers/tasks/setup-Debian.yml [new file with mode: 0644]
automation/ansible/roles/compilers/tasks/setup-RedHat.yml [new file with mode: 0644]
automation/ansible/roles/compilers/vars/Alpine.yml [new file with mode: 0644]
automation/ansible/roles/compilers/vars/Debian.yml [new file with mode: 0644]
automation/ansible/roles/compilers/vars/RedHat.yml [new file with mode: 0644]
automation/ansible/roles/compilers/vars/Suse.yml [new file with mode: 0644]

index 8b5638bd02ff37c55f494e268be744cd233b9313..d511eff6b3606fec26be0f7c8da76657ceda3ea5 100644 (file)
@@ -2,6 +2,7 @@
   roles:
     - common
     - cross-compilers
+    - compilers
     - babeltrace
     - liburcu
     - lttng-ust
index c5b6788a22a950c89f392156383dc4e7d203f815..509570df448c1ad3f340b79ae926debb1f20749b 100644 (file)
@@ -2,6 +2,7 @@
   roles:
     - common
     - cross-compilers
+    - compilers
     - babeltrace
     - liburcu
     - lttng-ust
diff --git a/automation/ansible/roles/compilers/tasks/main.yml b/automation/ansible/roles/compilers/tasks/main.yml
new file mode 100644 (file)
index 0000000..4595c12
--- /dev/null
@@ -0,0 +1,19 @@
+---
+# Include variables and define needed variables.
+- name: Include OS-specific variables.
+  include_vars: "{{ ansible_os_family }}.yml"
+
+- name: Define compilers_packages.
+  set_fact:
+    compilers_packages: "{{ __compilers_packages | list }}"
+  when: compilers_packages is not defined
+
+# Setup/install tasks.
+- include: setup-RedHat.yml
+  when: ansible_os_family == 'RedHat'
+
+- include: setup-Debian.yml
+  when: ansible_os_family == 'Debian'
+
+- include: setup-Alpine.yml
+  when: ansible_os_family == 'Alpine'
diff --git a/automation/ansible/roles/compilers/tasks/setup-Alpine.yml b/automation/ansible/roles/compilers/tasks/setup-Alpine.yml
new file mode 100644 (file)
index 0000000..387a52c
--- /dev/null
@@ -0,0 +1,7 @@
+---
+- name: Update apk cache.
+  apk: update_cache=yes
+
+- name: Ensure compilers packages are installed.
+  apk: "name={{ item }} state=present"
+  with_items: "{{ compilers_packages }}"
diff --git a/automation/ansible/roles/compilers/tasks/setup-Debian.yml b/automation/ansible/roles/compilers/tasks/setup-Debian.yml
new file mode 100644 (file)
index 0000000..5d150a1
--- /dev/null
@@ -0,0 +1,7 @@
+---
+- name: Update apt cache.
+  apt: update_cache=yes cache_valid_time=86400
+
+- name: Ensure compilers packages are installed.
+  apt: "name={{ item }} state=present"
+  with_items: "{{ compilers_packages }}"
diff --git a/automation/ansible/roles/compilers/tasks/setup-RedHat.yml b/automation/ansible/roles/compilers/tasks/setup-RedHat.yml
new file mode 100644 (file)
index 0000000..c45a5cc
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: Ensure compilers packages are installed.
+  yum:
+    name: "{{ item }}"
+    state: installed
+  with_items: "{{ compilers_packages }}"
diff --git a/automation/ansible/roles/compilers/vars/Alpine.yml b/automation/ansible/roles/compilers/vars/Alpine.yml
new file mode 100644 (file)
index 0000000..c06b535
--- /dev/null
@@ -0,0 +1,3 @@
+---
+# TODO
+__compilers_packages: []
diff --git a/automation/ansible/roles/compilers/vars/Debian.yml b/automation/ansible/roles/compilers/vars/Debian.yml
new file mode 100644 (file)
index 0000000..e9168eb
--- /dev/null
@@ -0,0 +1,17 @@
+---
+__compilers_packages:
+  - gcc-4.8
+  - gcc-5
+  - gcc-6
+  - gcc-7
+  - gcc-8
+  - g++-4.8
+  - g++-5
+  - g++-6
+  - g++-7
+  - g++-8
+  - clang-3.9
+  - clang-4.0
+  - clang-5.0
+  - clang-6.0
+  - clang-7
diff --git a/automation/ansible/roles/compilers/vars/RedHat.yml b/automation/ansible/roles/compilers/vars/RedHat.yml
new file mode 100644 (file)
index 0000000..bf746e2
--- /dev/null
@@ -0,0 +1,3 @@
+---
+# TODO
+__compilers_packages:
diff --git a/automation/ansible/roles/compilers/vars/Suse.yml b/automation/ansible/roles/compilers/vars/Suse.yml
new file mode 100644 (file)
index 0000000..c06b535
--- /dev/null
@@ -0,0 +1,3 @@
+---
+# TODO
+__compilers_packages: []
This page took 0.025699 seconds and 4 git commands to generate.