Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jalessio/ansible-role-ros
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ctu-vras/ansible-role-ros
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 11 commits
  • 14 files changed
  • 2 contributors

Commits on Jan 24, 2025

  1. Modernized the role.

    peci1 committed Jan 24, 2025
    Copy the full SHA
    7c8fb2d View commit details

Commits on Feb 5, 2025

  1. Update main.yml

    peci1 authored Feb 5, 2025
    Copy the full SHA
    6e48436 View commit details
  2. Update main.yml

    peci1 authored Feb 5, 2025
    Copy the full SHA
    3103ad5 View commit details
  3. Update main.yml

    peci1 authored Feb 5, 2025
    Copy the full SHA
    796e2bf View commit details

Commits on Feb 6, 2025

  1. Fixes.

    peci1 committed Feb 6, 2025
    Copy the full SHA
    5180132 View commit details
  2. Fixed role URL.

    peci1 committed Feb 6, 2025
    Copy the full SHA
    5a1871d View commit details
  3. Fixed linter.

    peci1 committed Feb 6, 2025
    Copy the full SHA
    4dd491e View commit details
  4. Copy the full SHA
    2666c0c View commit details
  5. Renamed role in readme.

    peci1 committed Feb 6, 2025
    Copy the full SHA
    875d41b View commit details
  6. Added deploy action.

    peci1 committed Feb 6, 2025
    Copy the full SHA
    5f3b2e1 View commit details
  7. Fixed linter.

    peci1 committed Feb 6, 2025
    Copy the full SHA
    1b8de81 View commit details
16 changes: 16 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Deploy to Galaxy

on:
- push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: galaxy
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
3 changes: 0 additions & 3 deletions .gitignore

This file was deleted.

50 changes: 0 additions & 50 deletions .kitchen.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

26 changes: 10 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Ansible Role: ROS

Ansible Galaxy: [jalessio.ROS](https://galaxy.ansible.com/list#/roles/2832)
Ansible Galaxy: [ctu_vras.ros](https://galaxy.ansible.com/ui/standalone/roles/ctu_vras/ros/)

[![Build Status](https://travis-ci.org/jalessio/ansible-role-ros.svg?branch=master)](https://travis-ci.org/jalessio/ansible-role-ros)

Installs the Robot Operating System (ROS) on Ubuntu linux servers.
Installs the Robot Operating System (ROS) on Ubuntu linux servers. It supports both ROS 1 and ROS 2 distros.

## Requirements

@@ -14,10 +12,13 @@ None.

Available variables are listed below, along with default values (see `defaults/main.yml`):

ros_release: "indigo"
ros_release: Defaults to the default ROS(2) version for the Ubuntu version. If no default is found, defaults to 'noetic'
ros_version: Defaults to "1" for ROS 1 distros and "2" for ROS 2 distros. You should not change this value.
ros_package: "ros-base"
ros_apt_uri: "http://packages.ros.org/ros/ubuntu"
ros_apt_uri: "http://packages.ros.org/ros/ubuntu" for ROS 1 and "http://packages.ros.org/ros2/ubuntu" for ROS 2
ros_apt_key: "https://raw.githubusercontent.com/ros/rosdistro/master/ros.key"
ros_apt_key_filename: "/usr/share/keyrings/ros-archive-keyring.gpg"
ros_apt_repo_filename: For ROS 1 distros, defaults to 'ros-latest'; for ROS 2 distros, defaults to 'ros2'

## Dependencies

@@ -27,19 +28,12 @@ None.

- hosts: server
roles:
- { role: jalessio.ros }

## Testing

This role is tested:

* locally with [Test Kitchen](http://kitchen.ci/) using the [kitchen-ansible plugin](https://github.com/neillturner/kitchen-ansible) and [Serverspec](http://serverspec.org/). The .kitchen.yml file specifies tests for installing ROS Indigo on Ubuntu 14.04, ROS Hydro on Ubuntu 12.04, and and ROS Groovy on Ubuntu 12.04.
* automatically via Travis CI at [https://travis-ci.org/jalessio/ansible-role-ros/](https://travis-ci.org/jalessio/ansible-role-ros/). Travis CI currently only tests installtion of ROS Groovy on Ubuntu 12.04 (since that's all Travis CI currently supports).
- { role: ctu-vras.ros }

## License

MIT / BSD
BSD

## Author Information

This role was created in 2015 by [Jamie Alessio](https://github.com/jalessio).
This role was created in 2015 by [Jamie Alessio](https://github.com/jalessio) and updated in 2025 by [Martin Pecka](https://github.com/peci1).
46 changes: 39 additions & 7 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,43 @@
---
# Currently supported ROS releases:
# - "groovy" on Ubuntu "precise"
# - "hydro" on Ubuntu "precise"
# - "indigo" on Ubuntu "trusty"
ros_release: "indigo"
# Translate ansible_architecture to dpkg --print-architecture
__ros_deb_architecture_map:
"armv6l": "armhf"
"armv7l": "armhf"
"aarch64": "arm64"
"x86_64": "amd64"
"i386": "i386"
ros_deb_architecture: "{{ __ros_deb_architecture_map[ansible_architecture] }}"

__ros_default_releases:
Ubuntu:
"18.04": "melodic"
"20.04": "noetic"
"22.04": "humble"
"24.04": "jazzy"
ros_release: "{{ __ros_default_releases.get(ansible_distribution, {}).get(ansible_distribution_version, 'noetic') }}"

__ros1_releases:
- boxturtle
- cturtle
- diamondback
- electric
- fuerte
- groovy
- hydro
- indigo
- jade
- kinetic
- lunar
- melodic
- noetic
- obese
ros_version: "{{ 1 if ros_release in __ros1_releases else 2 }}"
ros_apt_repo_filename: "{{ 'ros-latest' if ros_version == '1' else 'ros2' }}"

ros_package: "ros-base"

# Optionally use a mirror for the ROS packages
ros_apt_uri: "http://packages.ros.org/ros/ubuntu"
ros_apt_key: "https://raw.githubusercontent.com/ros/rosdistro/master/ros.key"
ros_apt_key_filename: "/usr/share/keyrings/ros-archive-keyring.gpg"

# Optionally use a mirror for the ROS packages
ros_apt_uri: "http://packages.ros.org/{{ 'ros' if ros_version == '1' else 'ros2' }}/ubuntu"
25 changes: 14 additions & 11 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -2,16 +2,19 @@
dependencies: []

galaxy_info:
author: jalessio
author: peci1
description: Robot Operating System (ROS) installation for Linux.
company: ""
license: "license (BSD, MIT)"
min_ansible_version: 1.4
namespace: ctu_vras
role_name: ros
company: "Czech Technical University in Prague"
license: "BSD"
min_ansible_version: "2.1"
platforms:
- name: Ubuntu
versions:
- precise
- trusty
categories:
- development
- system
- name: Ubuntu
versions:
- all
- galaxy_tags:
- development
- system
- ros
- robotics
50 changes: 42 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,49 @@
---
- name: Add ROS repository apt-key
apt_key:
url: "{{ ros_apt_key }}"

- name: Install software-properties-common
ansible.builtin.apt:
pkg: "software-properties-common"
state: present
when: ros_version == '2'

- name: Add universe repo
ansible.builtin.command: add-apt-repository universe -y # noqa: no-changed-when
when: ros_version == '2'

- name: Check ros keyring age
ansible.builtin.find:
paths: "{{ ros_apt_key_filename | dirname }}"
pattern: "{{ ros_apt_key_filename | basename }}"
age: -4w
recurse: false
register: ros_key_age

- name: Add ROS repository apt-key if not present or not updated in 1 month
ansible.builtin.get_url:
url: "{{ ros_apt_key }}"
dest: "{{ ros_apt_key_filename }}"
mode: '0644'
force: true
when: ros_key_age.files | length == 0

# We do not use apt_repository here to manage the record because we want to overwrite the (potentially) existing file
# instead of appending to it (to allow changing the repo mirrors if needed).
- name: Add ROS repository
apt_repository:
repo: "deb {{ ros_apt_uri }} {{ ansible_lsb.codename }} main"
state: present
ansible.builtin.copy:
content: "deb [arch={{ ros_deb_architecture }} signed-by={{ ros_apt_key_filename }}] {{ ros_apt_uri }} {{ ansible_lsb.codename }} main"
dest: "/etc/apt/sources.list.d/{{ ros_apt_repo_filename }}.list"
mode: "u=rw,g=r,o=r"
backup: true
register: ros_apt_repo

- name: Update packages after adding the ROS repo # noqa: no-handler
ansible.builtin.apt:
update_cache: true
upgrade: dist
cache_valid_time: 0
when: ros_apt_repo.changed

- name: Install desired ROS package
apt:
- name: Install desired ROS packages
ansible.builtin.apt:
pkg: "ros-{{ ros_release }}-{{ ros_package }}"
state: present
4 changes: 0 additions & 4 deletions test/integration/default.yml

This file was deleted.

14 changes: 0 additions & 14 deletions test/integration/groovy/serverspec/groovy_spec.rb

This file was deleted.

14 changes: 0 additions & 14 deletions test/integration/hydro/serverspec/hydro_spec.rb

This file was deleted.

14 changes: 0 additions & 14 deletions test/integration/indigo/serverspec/indigo_spec.rb

This file was deleted.

1 change: 0 additions & 1 deletion test/inventory

This file was deleted.

8 changes: 0 additions & 8 deletions test/travis.yml

This file was deleted.