Add sys_upgrade role
Copied from https://git.shivering-isles.com/shivering-isles/infrastructure/-/tree/master/roles/sys-upgrade
This commit is contained in:
parent
cada8a682a
commit
67b5b52bd7
7 changed files with 203 additions and 0 deletions
23
playbooks/sys_upgrade.yml
Normal file
23
playbooks/sys_upgrade.yml
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- sys_upgrade
|
||||||
|
environment:
|
||||||
|
PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages
|
24
roles/sys_upgrade/README.md
Normal file
24
roles/sys_upgrade/README.md
Normal file
|
@ -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
|
28
roles/sys_upgrade/meta/main.yml
Normal file
28
roles/sys_upgrade/meta/main.yml
Normal file
|
@ -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: []
|
40
roles/sys_upgrade/tasks/Debian.yml
Normal file
40
roles/sys_upgrade/tasks/Debian.yml
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
- 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
|
30
roles/sys_upgrade/tasks/Fedora.yml
Normal file
30
roles/sys_upgrade/tasks/Fedora.yml
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
- name: Upgrade all packages
|
||||||
|
ansible.builtin.dnf:
|
||||||
|
name: "*"
|
||||||
|
state: latest # noqa 403
|
||||||
|
update_cache: true
|
||||||
|
tags:
|
||||||
|
- dnf
|
||||||
|
- download
|
||||||
|
- packages
|
||||||
|
become: true
|
30
roles/sys_upgrade/tasks/RedHat.yml
Normal file
30
roles/sys_upgrade/tasks/RedHat.yml
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
- name: Upgrade all packages (RedHat-common)
|
||||||
|
ansible.builtin.yum:
|
||||||
|
name: "*"
|
||||||
|
state: latest # noqa 403
|
||||||
|
update_cache: true
|
||||||
|
tags:
|
||||||
|
- yum
|
||||||
|
- download
|
||||||
|
- packages
|
||||||
|
become: true
|
28
roles/sys_upgrade/tasks/main.yml
Normal file
28
roles/sys_upgrade/tasks/main.yml
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
- 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
|
Loading…
Add table
Reference in a new issue