-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook.yml
More file actions
60 lines (49 loc) · 1.62 KB
/
playbook.yml
File metadata and controls
60 lines (49 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: ROS2 Development Environment Setup
hosts: localhost
connection: local
gather_facts: yes
become: false
vars:
# ROS2 version (can be overridden with -e ros_distro=humble)
ros2_distro: "{{ ros_distro | default('jazzy') }}"
# Auto-detect Ubuntu version based on ROS2 distro
ros_ubuntu_mapping:
humble: "22.04"
jazzy: "24.04"
# Set Ubuntu version based on ROS2 distro
ubuntu_version: "{{ ros_ubuntu_mapping[ros2_distro] }}"
pre_tasks:
- name: Display installation target
debug:
msg: "Installing ROS2 {{ ros2_distro }} for Ubuntu {{ ubuntu_version }}"
- name: Verify Ubuntu version
fail:
msg: "This ROS2 {{ ros2_distro }} requires Ubuntu {{ ubuntu_version }}, but you have {{ ansible_distribution_version }}"
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_version != ubuntu_version
- name: Update apt cache
become: true
apt:
update_cache: yes
cache_valid_time: 3600
tasks:
- name: Install dependencies
import_tasks: tasks/dependencies.yml
- name: Install ROS2
import_tasks: tasks/ros2.yml
- name: Install extras
import_tasks: tasks/extras.yml
- name: Install Docker
import_tasks: tasks/docker.yml
- name: Install Visual Studio Code
import_tasks: tasks/vscode.yml
post_tasks:
- name: Display completion message
debug:
msg:
- "Installation complete!"
- "ROS2 {{ ros2_distro }} is ready to use"
- "Run: source ~/.bashrc (or open new terminal)"
- "Docker group requires logout/login"