diff --git a/defaults/main.yml b/defaults/main.yml index 93835bb..8031510 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,6 @@ --- # defaults file for ansible-role-install-ros2-ubuntu -install_ros2_distro: "dashing" -install_ros2: "ros-base" \ No newline at end of file +install_ros2_distro: "galactic" +install_ros2: "ros-base" +install_ros2_rti_connext: true +install_ros2_rti_fastrtps: false diff --git a/meta/main.yml b/meta/main.yml index 88bba14..6e8fc58 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -39,6 +39,7 @@ galaxy_info: versions: - bionic - focal + - jammy galaxy_tags: # Maximum 20 tags per role. @@ -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, diff --git a/tasks/main.yml b/tasks/main.yml index 999afb3..1007bd7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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: @@ -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" @@ -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