This repository was archived by the owner on Oct 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +53
-3
lines changed Expand file tree Collapse file tree 2 files changed +53
-3
lines changed Original file line number Diff line number Diff line change 11---
2- - name : Install additional extra packages.
2+ - name : Define empty wget list
3+ ansible.builtin.set_fact :
4+ wget_list : []
5+
6+ - name : Define empty apt list
7+ ansible.builtin.set_fact :
8+ apt_list : []
9+
10+ - name : Add URLs to wget list
11+ ansible.builtin.set_fact :
12+ wget_list : " {{ wget_list + [item] }}"
13+ loop : " {{ apt_extra_packages }}"
14+ when : " item is regex('^https?://')"
15+
16+ - name : Add URLs to apt list
17+ ansible.builtin.set_fact :
18+ apt_list : " {{ apt_list + [item] }}"
19+ when : " item is not regex('^https?://')"
20+ loop : " {{ apt_extra_packages }}"
21+
22+ - name : Install additional apt extra packages.
323 ansible.builtin.apt :
4- pkg : " {{ apt_extra_packages | list }}"
24+ pkg : " {{ apt_list | list }}"
525 state : present
626 update_cache : true
7- when : apt_extra_packages | length
27+ when : apt_list | length > 0
28+
29+ - name : Install additional wget extra packages.
30+ ansible.builtin.include_tasks : " wget_install.yml"
31+ when : wget_list | length > 0
32+ loop : " {{ wget_list }}"
33+ loop_control :
34+ loop_var : wget_item
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Check if download folder exists
3+ ansible.builtin.file :
4+ path : /home/{{ user_deploy.username }}/apt_exta
5+ state : directory
6+ mode : ' 0755'
7+ owner : " {{ user_deploy.username }}"
8+ group : " {{ user_deploy.username }}"
9+
10+ - name : Get package name
11+ ansible.builtin.set_fact :
12+ package_name : " {{ wget_item.split('/')[-1] }}"
13+
14+ - name : Download package
15+ ansible.builtin.get_url :
16+ url : " {{ wget_item }}"
17+ dest : " /home/{{ user_deploy.username }}/apt_exta/{{ package_name }}"
18+ owner : " {{ user_deploy.username }}"
19+ group : " {{ user_deploy.username }}"
20+
21+ - name : Instal package
22+ ansible.builtin.apt :
23+ deb : /home/{{ user_deploy.username }}/apt_exta/{{ package_name }}
You can’t perform that action at this time.
0 commit comments