mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 05:45:06 +03:00
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.
This commit is contained in:
@@ -62,23 +62,3 @@
|
|||||||
- '"changed its" in bootstrap_update_apt_result.stdout'
|
- '"changed its" in bootstrap_update_apt_result.stdout'
|
||||||
- '"value from" in bootstrap_update_apt_result.stdout'
|
- '"value from" in bootstrap_update_apt_result.stdout'
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Check unattended-upgrades file exist
|
|
||||||
stat:
|
|
||||||
path: /etc/apt/apt.conf.d/50unattended-upgrades
|
|
||||||
register: unattended_upgrades_file_stat
|
|
||||||
when:
|
|
||||||
- os_release_dict['ID'] == 'ubuntu'
|
|
||||||
- ubuntu_kernel_unattended_upgrades_disabled
|
|
||||||
|
|
||||||
- name: Disable kernel unattended-upgrades
|
|
||||||
lineinfile:
|
|
||||||
path: "{{ unattended_upgrades_file_stat.stat.path }}"
|
|
||||||
insertafter: "Unattended-Upgrade::Package-Blacklist"
|
|
||||||
line: '"linux-";'
|
|
||||||
state: present
|
|
||||||
become: true
|
|
||||||
when:
|
|
||||||
- os_release_dict['ID'] == 'ubuntu'
|
|
||||||
- ubuntu_kernel_unattended_upgrades_disabled
|
|
||||||
- unattended_upgrades_file_stat.stat.exists
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
centos.yml
|
|
||||||
3
roles/bootstrap-os/tasks/openEuler.yml
Normal file
3
roles/bootstrap-os/tasks/openEuler.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- name: Import Centos boostrap for openEuler
|
||||||
|
import_tasks: centos.yml
|
||||||
@@ -1 +0,0 @@
|
|||||||
opensuse.yml
|
|
||||||
3
roles/bootstrap-os/tasks/opensuse-leap.yml
Normal file
3
roles/bootstrap-os/tasks/opensuse-leap.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- name: Import Opensuse bootstrap
|
||||||
|
import_tasks: opensuse.yml
|
||||||
@@ -1 +0,0 @@
|
|||||||
opensuse.yml
|
|
||||||
3
roles/bootstrap-os/tasks/opensuse-tumbleweed.yml
Normal file
3
roles/bootstrap-os/tasks/opensuse-tumbleweed.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- name: Import Opensuse bootstrap
|
||||||
|
import_tasks: opensuse.yml
|
||||||
@@ -1 +0,0 @@
|
|||||||
debian.yml
|
|
||||||
21
roles/bootstrap-os/tasks/ubuntu.yml
Normal file
21
roles/bootstrap-os/tasks/ubuntu.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
- name: Import Debian bootstrap
|
||||||
|
import_tasks: debian.yml
|
||||||
|
|
||||||
|
- name: Check unattended-upgrades file exist
|
||||||
|
stat:
|
||||||
|
path: /etc/apt/apt.conf.d/50unattended-upgrades
|
||||||
|
register: unattended_upgrades_file_stat
|
||||||
|
when:
|
||||||
|
- ubuntu_kernel_unattended_upgrades_disabled
|
||||||
|
|
||||||
|
- name: Disable kernel unattended-upgrades
|
||||||
|
lineinfile:
|
||||||
|
path: "{{ unattended_upgrades_file_stat.stat.path }}"
|
||||||
|
insertafter: "Unattended-Upgrade::Package-Blacklist"
|
||||||
|
line: '"linux-";'
|
||||||
|
state: present
|
||||||
|
become: true
|
||||||
|
when:
|
||||||
|
- ubuntu_kernel_unattended_upgrades_disabled
|
||||||
|
- unattended_upgrades_file_stat.stat.exists
|
||||||
Reference in New Issue
Block a user