diff --git a/playbooks/sys_upgrade.yml b/playbooks/sys_upgrade.yml new file mode 100644 index 0000000..a762c4f --- /dev/null +++ b/playbooks/sys_upgrade.yml @@ -0,0 +1,23 @@ +--- + +# Infrastructure +# Ansible instructions to deploy the infrastructure +# Copyright (C) 2022 Saibotk +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +- hosts: all + roles: + - sys_upgrade + environment: + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/roles/sys_upgrade/README.md b/roles/sys_upgrade/README.md new file mode 100644 index 0000000..9ec5aad --- /dev/null +++ b/roles/sys_upgrade/README.md @@ -0,0 +1,24 @@ +sys_upgrade +========= + +Installs the latest updates to a system via the respective package manager. + +Requirements +------------ + +None + +Role Variables +-------------- + +None + +Dependencies +------------ + +None. + +License +------- + +GPL-3.0-only diff --git a/roles/sys_upgrade/meta/main.yml b/roles/sys_upgrade/meta/main.yml new file mode 100644 index 0000000..ec75e89 --- /dev/null +++ b/roles/sys_upgrade/meta/main.yml @@ -0,0 +1,28 @@ +galaxy_info: + author: Christoph Kern + description: Upgrades System so latest packages are installed + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + issue_tracker_url: https://github.com/SISheogorath/ansible-client/issues + + license: GPL-3.0-only + + min_ansible_version: 2.9 + + # + # platforms is a list of platforms, and each platform has a name and a list of versions. + # + platforms: + - name: Fedora + versions: + - all + - name: CentOS + versions: + - 7 + - name: Debian + versions: + - all + + galaxy_tags: [] +dependencies: [] diff --git a/roles/sys_upgrade/tasks/Debian.yml b/roles/sys_upgrade/tasks/Debian.yml new file mode 100644 index 0000000..96211de --- /dev/null +++ b/roles/sys_upgrade/tasks/Debian.yml @@ -0,0 +1,40 @@ +--- +# tasks file for sys-upgrade + +# Shivering-Isles Infrastructure +# Ansible instructions to deploy the infrastructure for the Shivering-Isles +# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +- name: Install aptitude + ansible.builtin.apt: + name: "aptitude" + state: present + tags: + - apt + - download + - packages + become: true + +- name: Upgrade all packages + ansible.builtin.apt: + name: "*" + state: latest # noqa 403 + update_cache: true + tags: + - apt + - download + - packages + become: true diff --git a/roles/sys_upgrade/tasks/Fedora.yml b/roles/sys_upgrade/tasks/Fedora.yml new file mode 100644 index 0000000..f81e92e --- /dev/null +++ b/roles/sys_upgrade/tasks/Fedora.yml @@ -0,0 +1,30 @@ +--- +# tasks file for sys-upgrade + +# Shivering-Isles Infrastructure +# Ansible instructions to deploy the infrastructure for the Shivering-Isles +# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +- name: Upgrade all packages + ansible.builtin.dnf: + name: "*" + state: latest # noqa 403 + update_cache: true + tags: + - dnf + - download + - packages + become: true diff --git a/roles/sys_upgrade/tasks/RedHat.yml b/roles/sys_upgrade/tasks/RedHat.yml new file mode 100644 index 0000000..6d5a730 --- /dev/null +++ b/roles/sys_upgrade/tasks/RedHat.yml @@ -0,0 +1,30 @@ +--- +# tasks file for sys-upgrade + +# Shivering-Isles Infrastructure +# Ansible instructions to deploy the infrastructure for the Shivering-Isles +# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +- name: Upgrade all packages (RedHat-common) + ansible.builtin.yum: + name: "*" + state: latest # noqa 403 + update_cache: true + tags: + - yum + - download + - packages + become: true diff --git a/roles/sys_upgrade/tasks/main.yml b/roles/sys_upgrade/tasks/main.yml new file mode 100644 index 0000000..2f5ec0c --- /dev/null +++ b/roles/sys_upgrade/tasks/main.yml @@ -0,0 +1,28 @@ +--- +# tasks file for sys-upgrade + +# Shivering-Isles Infrastructure +# Ansible instructions to deploy the infrastructure for the Shivering-Isles +# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +- name: "Select tasks for {{ ansible_distribution }} {{ ansible_distribution_major_version }}" + ansible.builtin.include_tasks: "{{ distro_file }}" + with_first_found: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_distribution }}.yml" + - "{{ ansible_os_family }}.yml" + loop_control: + loop_var: distro_file