-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdistr_vbox_quest_tools_debian11.yml
More file actions
74 lines (61 loc) · 2.22 KB
/
distr_vbox_quest_tools_debian11.yml
File metadata and controls
74 lines (61 loc) · 2.22 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- name: Ansible script for Debian 11+, that need to guest (debian) OS, like drivers for windows.
hosts: "{{ variable_host | default('localhost') }}"
become_user: '{{ name_of_user }}'
become_method: 'sudo'
vars:
path_to_mout_cd: /media/cdrom0
list_soft:
- build-essential
- dkms
- linux-headers-{{ ansible_kernel }}
list_repository:
- deb https://fasttrack.debian.net/debian-fasttrack/ bullseye-fasttrack main contrib
- deb https://fasttrack.debian.net/debian-fasttrack/ bullseye-backports-staging main contrib
- deb http://fasttrack.debian.net/debian-fasttrack/ bullseye-fasttrack main contrib
- deb http://fasttrack.debian.net/debian-fasttrack/ bullseye-backports-staging main contrib
vars_prompt:
- name: name_of_user
prompt: "Please enter the name of user, for which we are making settings (default root) \n"
private: no
default: root
tasks:
- name: Remove CD-Rom Repository
ansible.builtin.replace:
path: '/etc/apt/sources.list'
regexp: '(.+)cdrom:\[Debian(.+)$'
replace: '# \1'
become: yes
- name: Add key for Fasstrack repository
ansible.builtin.apt:
pkg: fasttrack-archive-keyring
state: present
become: yes
- name: Add FastTrack repository to APT
ansible.builtin.apt_repository:
repo: "{{ item }}"
state: present
become: yes
with_list: "{{ list_repository }}"
- name: Install the necessary packages
apt:
# cache_valid_time: 28800
update_cache: yes
pkg: '{{ list_soft }}'
state: present
become: yes
- name: Try to mount CD-ROM (in VBox you must click Device->Insert Guest Additional)
ansible.posix.mount:
path: "{{ path_to_mout_cd }}"
src: /dev/sr0
fstype: iso9660
opts: ro,noauto
state: remounted
- name: Copy script to Temp direcory and set +x on script
ansible.builtin.copy:
src: "{{ path_to_mout_cd }}/VBoxLinuxAdditions.run"
dest: "/tmp/VBoxLinuxAdditions.run"
mode: u+rwx,g+rwx,o+rwx
remote_src: yes
- name: Run script to intall Additionals tools
ansible.builtin.shell: "/tmp/VBoxLinuxAdditions.run"