|
1 | 1 | # tasks file |
2 | 2 | --- |
3 | 3 | - name: update configuration file - /etc/apt/sources.list |
4 | | - template: |
| 4 | + ansible.builtin.template: |
5 | 5 | src: "etc/apt/sources.list.{{ ansible_distribution }}.j2" |
6 | 6 | dest: /etc/apt/sources.list |
7 | 7 | owner: root |
|
15 | 15 | - apt-configuration |
16 | 16 |
|
17 | 17 | - name: update configuration file - /etc/apt/apt.conf |
18 | | - template: |
| 18 | + ansible.builtin.template: |
19 | 19 | src: "{{ apt_apt_conf_file.lstrip('/') }}.j2" |
20 | 20 | dest: "{{ apt_apt_conf_file }}" |
21 | 21 | owner: root |
|
28 | 28 | - apt-configuration |
29 | 29 |
|
30 | 30 | - name: remove configuration files - /etc/apt/apt.conf.d/* |
31 | | - file: |
| 31 | + ansible.builtin.file: |
32 | 32 | path: "/etc/apt/apt.conf.d/{{ item }}" |
33 | 33 | state: absent |
34 | 34 | with_items: "{{ apt_etc_apt_apt_conf_d_files_absent }}" |
|
38 | 38 | - apt-configuration |
39 | 39 |
|
40 | 40 | - name: ensure directory exists - /var/lib/apt/lists/ |
41 | | - file: |
| 41 | + ansible.builtin.file: |
42 | 42 | path: /var/lib/apt/lists/ |
43 | 43 | state: directory |
44 | 44 | owner: root |
|
50 | 50 | - apt-update |
51 | 51 |
|
52 | 52 | - name: update |
53 | | - apt: |
| 53 | + ansible.builtin.apt: |
54 | 54 | update_cache: true |
55 | 55 | cache_valid_time: "{{ 0 if apt_config_updated is defined and apt_config_updated.changed else apt_update_cache_valid_time }}" |
56 | 56 | when: apt_update |
|
60 | 60 | - apt-update |
61 | 61 |
|
62 | 62 | - name: dpkg --configure |
63 | | - command: > |
| 63 | + ansible.builtin.command: > |
64 | 64 | dpkg --configure -a |
65 | 65 | args: |
66 | 66 | warn: false |
|
73 | 73 | - apt-dpkg-configure |
74 | 74 |
|
75 | 75 | - name: install dependencies |
76 | | - apt: |
| 76 | + ansible.builtin.apt: |
77 | 77 | name: "{{ apt_dependencies }}" |
78 | 78 | state: "{{ apt_install_state }}" |
79 | 79 | tags: |
|
82 | 82 | - apt-dependencies |
83 | 83 |
|
84 | 84 | - name: upgrade |
85 | | - apt: |
| 85 | + ansible.builtin.apt: |
86 | 86 | upgrade: "{{ apt_upgrade_type }}" |
87 | 87 | update_cache: true |
88 | 88 | dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}" |
|
93 | 93 | - apt-upgrade |
94 | 94 |
|
95 | 95 | - name: clean |
96 | | - command: > |
| 96 | + ansible.builtin.command: > |
97 | 97 | apt-get -y clean |
98 | 98 | args: |
99 | 99 | warn: false |
|
105 | 105 | - apt-clean |
106 | 106 |
|
107 | 107 | - name: install |
108 | | - apt: |
| 108 | + ansible.builtin.apt: |
109 | 109 | name: "{{ apt_install }}" |
110 | 110 | state: "{{ apt_install_state }}" |
111 | 111 | tags: |
|
114 | 114 | - apt-install |
115 | 115 |
|
116 | 116 | - name: remove |
117 | | - apt: |
| 117 | + ansible.builtin.apt: |
118 | 118 | name: "{{ apt_remove }}" |
119 | 119 | state: absent |
120 | 120 | purge: "{{ apt_remove_purge }}" |
|
124 | 124 | - apt-remove |
125 | 125 |
|
126 | 126 | - name: autoremove |
127 | | - apt: |
| 127 | + ansible.builtin.apt: |
128 | 128 | autoremove: true |
129 | 129 | dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}" |
130 | 130 | when: apt_autoremove |
|
0 commit comments