diff --git a/roles/editor_vscode/tasks/install_AlmaLinux.yml b/roles/editor_vscode/tasks/install_AlmaLinux.yml deleted file mode 120000 index c10604b..0000000 --- a/roles/editor_vscode/tasks/install_AlmaLinux.yml +++ /dev/null @@ -1 +0,0 @@ -install_rhel.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_CentOS.yml b/roles/editor_vscode/tasks/install_CentOS.yml deleted file mode 120000 index c10604b..0000000 --- a/roles/editor_vscode/tasks/install_CentOS.yml +++ /dev/null @@ -1 +0,0 @@ -install_rhel.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_Debian.yml b/roles/editor_vscode/tasks/install_Debian.yml deleted file mode 120000 index 38e6c00..0000000 --- a/roles/editor_vscode/tasks/install_Debian.yml +++ /dev/null @@ -1 +0,0 @@ -install_deb.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_Fedora.yml b/roles/editor_vscode/tasks/install_Fedora.yml deleted file mode 120000 index c10604b..0000000 --- a/roles/editor_vscode/tasks/install_Fedora.yml +++ /dev/null @@ -1 +0,0 @@ -install_rhel.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_Rocky.yml b/roles/editor_vscode/tasks/install_Rocky.yml deleted file mode 120000 index c10604b..0000000 --- a/roles/editor_vscode/tasks/install_Rocky.yml +++ /dev/null @@ -1 +0,0 @@ -install_rhel.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_Ubuntu.yml b/roles/editor_vscode/tasks/install_Ubuntu.yml deleted file mode 120000 index 38e6c00..0000000 --- a/roles/editor_vscode/tasks/install_Ubuntu.yml +++ /dev/null @@ -1 +0,0 @@ -install_deb.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_deb.yml b/roles/editor_vscode/tasks/install_apt.yml similarity index 100% rename from roles/editor_vscode/tasks/install_deb.yml rename to roles/editor_vscode/tasks/install_apt.yml diff --git a/roles/editor_vscode/tasks/install_dnf.yml b/roles/editor_vscode/tasks/install_dnf.yml new file mode 120000 index 0000000..463b6d3 --- /dev/null +++ b/roles/editor_vscode/tasks/install_dnf.yml @@ -0,0 +1 @@ +install_rpm.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_dnf5.yml b/roles/editor_vscode/tasks/install_dnf5.yml new file mode 120000 index 0000000..463b6d3 --- /dev/null +++ b/roles/editor_vscode/tasks/install_dnf5.yml @@ -0,0 +1 @@ +install_rpm.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/install_rhel.yml b/roles/editor_vscode/tasks/install_rpm.yml similarity index 51% rename from roles/editor_vscode/tasks/install_rhel.yml rename to roles/editor_vscode/tasks/install_rpm.yml index ddd8085..113447d 100644 --- a/roles/editor_vscode/tasks/install_rhel.yml +++ b/roles/editor_vscode/tasks/install_rpm.yml @@ -4,9 +4,18 @@ url: https://code.visualstudio.com/sha/download?build=insider&os=linux-rpm-x64 register: _vscode_rpm_response -- name: Install VSCode via RPM +- name: Install VSCode via dnf ansible.builtin.dnf: name: "{{ _vscode_rpm_response.url }}" disable_gpg_check: true state: present become: true + when: ansible_facts.pkg_mgr.startswith("dnf") + +- name: Install VSCode via zypper + community.general.zypper: + name: "{{ _vscode_rpm_response.url }}" + disable_gpg_check: true + state: present + become: true + when: ansible_facts.pkg_mgr == "zypper" diff --git a/roles/editor_vscode/tasks/install_zypper.yml b/roles/editor_vscode/tasks/install_zypper.yml new file mode 120000 index 0000000..463b6d3 --- /dev/null +++ b/roles/editor_vscode/tasks/install_zypper.yml @@ -0,0 +1 @@ +install_rpm.yml \ No newline at end of file diff --git a/roles/editor_vscode/tasks/main.yml b/roles/editor_vscode/tasks/main.yml index efb2aed..4a1f134 100644 --- a/roles/editor_vscode/tasks/main.yml +++ b/roles/editor_vscode/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Install VSCode - ansible.builtin.include_tasks: "install_{{ ansible_distribution }}.yml" + ansible.builtin.include_tasks: "install_{{ ansible_facts.pkg_mgr }}.yml" tags: install - name: Create directories for VSCode