ansible: Add role for developer tools
authorKienan Stewart <kstewart@efficios.com>
Tue, 31 Oct 2023 13:55:14 +0000 (09:55 -0400)
committerKienan Stewart <kstewart@efficios.com>
Thu, 30 Nov 2023 16:37:38 +0000 (11:37 -0500)
The idea of the developer tools roles is to provide commonly used by
people working interactively in an environment on LTTng or other
projects.

This first pass is based on https://github.com/jgalar/lttng-dockerfiles

Change-Id: I2b822602dfeb08bf59ab5094cee2f0554845a614

automation/ansible/roles/developer/defaults/main.yml [new file with mode: 0644]
automation/ansible/roles/developer/tasks/main.yml [new file with mode: 0644]

diff --git a/automation/ansible/roles/developer/defaults/main.yml b/automation/ansible/roles/developer/defaults/main.yml
new file mode 100644 (file)
index 0000000..f44e038
--- /dev/null
@@ -0,0 +1,18 @@
+---
+developer_install_gui: false
+developer_gui_packages: []
+
+developer_install_tui: true
+developer_tui_packages:
+  - emacs-nox
+  - gdb
+  - pkg-config
+  - tmux
+  - vim-nox
+  # wget may be used by some vlttng commands
+  - wget
+
+developer_install_vlttng: true
+developer_pip_requirements:
+  - python3-pip
+  - python3-setuptools
diff --git a/automation/ansible/roles/developer/tasks/main.yml b/automation/ansible/roles/developer/tasks/main.yml
new file mode 100644 (file)
index 0000000..b16b1a7
--- /dev/null
@@ -0,0 +1,34 @@
+---
+- name: Include OS-specific variables
+  ansible.builtin.include_vars: "{{item}}"
+  with_first_found:
+    - files:
+        - "{{ansible_distribution}}-{{ansible_distribution_major_version}}.yml"
+        - "{{ansible_distribution}}-{{ansible_distribution_release}}.yml"
+        - "{{ansible_distribution}}.yml"
+        - "{{ansible_os_family}}.yml"
+      skip: true
+- name: OS-specific setup
+  ansible.builtin.include_tasks: "{{item}}"
+  with_first_found:
+    - files:
+        - "setup-{{ansible_os_family}}.yml"
+      skip: true
+- name: Install vlttng
+  block:
+    - name: Install requirements to run pip
+      ansible.builtin.package:
+        name: "{{developer_pip_requirements}}"
+    - name: Install vlttng using pip
+      when: ansible_python_version is version("3.11", ">=")
+      ansible.builtin.pip:
+        name: vlttng
+        extra_args: "{{(ansible_python_version is version('3.11', '>='))|ternary('--break-system-packages', '')}}"
+- name: Install developer TUI tools
+  when: developer_install_tui
+  ansible.builtin.package:
+    name: "{{developer_tui_packages}}"
+- name: Install developer GUI tools
+  when: developer_install_gui
+  ansible.builtin.package:
+    name: "{{developer_gui_packages}}"
This page took 0.023981 seconds and 4 git commands to generate.