From: Kienan Stewart Date: Tue, 31 Oct 2023 13:55:14 +0000 (-0400) Subject: ansible: Add role for developer tools X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b95bc3113ef6c9370c4b63c2da5a6b0dedb20d48;p=lttng-ci.git ansible: Add role for developer tools 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 --- diff --git a/automation/ansible/roles/developer/defaults/main.yml b/automation/ansible/roles/developer/defaults/main.yml new file mode 100644 index 0000000..f44e038 --- /dev/null +++ b/automation/ansible/roles/developer/defaults/main.yml @@ -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 index 0000000..b16b1a7 --- /dev/null +++ b/automation/ansible/roles/developer/tasks/main.yml @@ -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}}"