Skip to content

Commit f9ebd45

Browse files
authored
boostrap-os: use import_tasks instead of symlinks (#11508)
Working symlinks are dependant on git configuration (when using the playbook as a git repository, which is common), precisely `git config core.symlinks`. While this is enabled by default, some company policies will disable it. Instead, use import_tasks which should avoid that class of bugs.
1 parent 7f527f6 commit f9ebd45

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

roles/bootstrap-os/tasks/debian.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,3 @@
6262
- '"changed its" in bootstrap_update_apt_result.stdout'
6363
- '"value from" in bootstrap_update_apt_result.stdout'
6464
ignore_errors: true
65-
66-
- name: Check unattended-upgrades file exist
67-
stat:
68-
path: /etc/apt/apt.conf.d/50unattended-upgrades
69-
register: unattended_upgrades_file_stat
70-
when:
71-
- os_release_dict['ID'] == 'ubuntu'
72-
- ubuntu_kernel_unattended_upgrades_disabled
73-
74-
- name: Disable kernel unattended-upgrades
75-
lineinfile:
76-
path: "{{ unattended_upgrades_file_stat.stat.path }}"
77-
insertafter: "Unattended-Upgrade::Package-Blacklist"
78-
line: '"linux-";'
79-
state: present
80-
become: true
81-
when:
82-
- os_release_dict['ID'] == 'ubuntu'
83-
- ubuntu_kernel_unattended_upgrades_disabled
84-
- unattended_upgrades_file_stat.stat.exists

roles/bootstrap-os/tasks/openEuler.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- name: Import Centos boostrap for openEuler
3+
import_tasks: centos.yml

roles/bootstrap-os/tasks/opensuse-leap.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- name: Import Opensuse bootstrap
3+
import_tasks: opensuse.yml

roles/bootstrap-os/tasks/opensuse-tumbleweed.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- name: Import Opensuse bootstrap
3+
import_tasks: opensuse.yml

roles/bootstrap-os/tasks/ubuntu.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

roles/bootstrap-os/tasks/ubuntu.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
- name: Import Debian bootstrap
3+
import_tasks: debian.yml
4+
5+
- name: Check unattended-upgrades file exist
6+
stat:
7+
path: /etc/apt/apt.conf.d/50unattended-upgrades
8+
register: unattended_upgrades_file_stat
9+
when:
10+
- ubuntu_kernel_unattended_upgrades_disabled
11+
12+
- name: Disable kernel unattended-upgrades
13+
lineinfile:
14+
path: "{{ unattended_upgrades_file_stat.stat.path }}"
15+
insertafter: "Unattended-Upgrade::Package-Blacklist"
16+
line: '"linux-";'
17+
state: present
18+
become: true
19+
when:
20+
- ubuntu_kernel_unattended_upgrades_disabled
21+
- unattended_upgrades_file_stat.stat.exists

0 commit comments

Comments
 (0)