-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathplaybook.yml
79 lines (67 loc) · 2.62 KB
/
playbook.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
- hosts: localhost,all
name: SOP Robot Bootstrap
connection: local
pre_tasks:
- name: Verify Ansible meets version requirements.
ansible.builtin.assert:
that: "ansible_version.full is version_compare('2.10', '>=')"
msg: >
"You must update Ansible to at least 2.10 to use this playbook."
tasks:
- name: Add settings to .bashrc for {{ ansible_env.USER }}
block:
- name: Create workspace folder for {{ ansible_env.USER }}
become: true
ansible.builtin.file:
path: /home/{{ ansible_env.USER }}/SOP-Robot
state: directory
owner: "{{ ansible_env.USER }}"
group: "{{ ansible_env.USER }}"
mode: "0755"
- name: Clone SOP-Robot repository into /home/{{ ansible_env.USER }}/SOP-Robot
become: false
ansible.builtin.git:
repo: https://github.com/ouspg/SOP-Robot.git
dest: /home/{{ ansible_env.USER }}/SOP-Robot
version: master
update: false
- name: Export workspace in .bashrc for {{ ansible_env.USER }}
ansible.builtin.lineinfile:
path: /home/{{ ansible_env.USER }}/.bashrc
line: export WORKSPACE=/home/{{ ansible_env.USER }}/SOP-Robot
state: present
- name: Add cd to workspace in .bashrc for {{ ansible_env.USER }}
ansible.builtin.lineinfile:
path: /home/{{ ansible_env.USER }}/.bashrc
line: cd $WORKSPACE
state: present
- name: Update and upgrade apt packages
become: true
ansible.builtin.apt:
upgrade: true
update_cache: true
autoremove: true
- name: Install Gnome and X11 forwarding
ansible.builtin.include_role:
name: desktop
- name: Install ROS
ansible.builtin.include_role:
name: ros-humble
- name: Clone and build control_toolbox
ansible.builtin.include_role:
name: ros-control
- name: Build SOP-Robot
ansible.builtin.include_role:
name: ros-sop-robot
- name: Enable colcon autocompletion
ansible.builtin.lineinfile:
path: /home/{{ ansible_env.USER }}/.bashrc
line: source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
state: present
- name: Download and unzip tts model
ansible.builtin.unarchive:
src: https://github.com/ouspg/SOP-Robot/releases/download/model/model.zip
dest: /home/{{ ansible_env.USER }}/SOP-Robot/src/tts_package/resource
remote_src: true
creates: /home/{{ ansible_env.USER }}/SOP-Robot/src/tts_package/resource/config.json