Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# defaults file for ansible-role-install-ros2-ubuntu
install_ros2_distro: "dashing"
install_ros2: "ros-base"
install_ros2_distro: "galactic"
install_ros2: "ros-base"
install_ros2_rti_connext: true
install_ros2_rti_fastrtps: false
2 changes: 2 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ galaxy_info:
versions:
- bionic
- focal
- jammy

galaxy_tags:
# Maximum 20 tags per role.
Expand All @@ -50,6 +51,7 @@ galaxy_info:
- dds
- rti
- connext
- fastrtps

dependencies:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
Expand Down
24 changes: 22 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
with_items:
- { os_release: "bionic", ros2_distro: "dashing" }
- { os_release: "focal", ros2_distro: "foxy" }
- { os_release: "jammy", ros2_distro: "galactic" }

- name: "Install ROS2 '{{ install_ros2_distro }}'"
- name: "Install ROS2 '{{ install_ros2_distro }}' on '{{ ansible_distribution_release }}'"
include_role:
name: itnok.manage_pkg_ubuntu
vars:
Expand All @@ -38,6 +39,7 @@
package_facts:
manager: auto


- name: "Set 'install_ros2_rti_connext_pkg' to 'ros-{{ install_ros2_distro }}-rmw-connext-cpp'"
set_fact:
install_ros2_rti_connext_pkg: "ros-{{ install_ros2_distro }}-rmw-connext-cpp"
Expand All @@ -53,4 +55,22 @@
- "yes"
echo: true
timeout: 600
when: ansible_facts.packages[install_ros2_rti_connext_pkg] is not defined
when: install_ros2_rti_connext and ansible_facts.packages[install_ros2_rti_connext_pkg] is not defined


- name: "Set 'install_ros2_rti_fastrtps_pkg' to 'ros-{{ install_ros2_distro }}-rmw-fastrtps-cpp'"
set_fact:
install_ros2_rti_fastrtps_pkg: "ros-{{ install_ros2_distro }}-rmw-fastrtps-cpp"

- name: "Install Eproxima FastRTPS DDS & middleware for ROS2 if not present"
expect:
command: "apt install -y --install-recommends {{ install_ros2_rti_fastrtps_pkg }}"
responses:
"--More--": [ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " ]
"Do you accept the terms of this license agreement.*":
- "yes"
- "yes"
- "yes"
echo: true
timeout: 600
when: install_ros2_rti_fastrtps and ansible_facts.packages[install_ros2_rti_fastrtps_pkg] is not defined