Giter VIP home page Giter VIP logo

ansible-uyuni's Introduction

This repository is an archive, development continues in the Uyuni Ansible collection

uyuni

This role prepares, installs and configures Uyuni and SUSE Manager.

Requirements

Make sure to install the jmespath and xml Python modules.

The system needs access to the internet. Also, you will need an openSUSE Leap 15.x or SUSE Linux Enterprise Server 15.x installation.

Role Variables

Variable Default Description
uyuni_suma_release 4.3 SUSE Manager release to install (4.2 to 4.3)
uyuni_release empty Uyuni release to install (e.g. 2023.03)
uyuni_scc_reg_code - ย SUSE Customer Center registration code (received after trial registration or purchase)
uyuni_scc_mail - SUSE Customer Center mail address
uyuni_scc_check_registration true Register system if unregistered
uyuni_scc_check_modules true Activate required modules if not already enabled
uyuni_sles_modules (Modules required for SUSE Manager 4.x) Modules to enable before installation
uyuni_use_lvm true Use LVM to create application volumes
uyuni_vg uyuni LVM volume group to create for Docker data
uyuni_pv /dev/sdb Disk to use for LVM
uyuni_filesystems see defaults/main.yml LVs, filesystems and mount points to create
uyuni_mail root@localhost Web server administrator mail
uyuni_db_name uyuni Database name
uyuni_db_user uyuni Database user
uyuni_db_pass Uyuni1337 Database password
uyuni_cert_city Darmstadt Certificate city
uyuni_cert_country DE Certificate country
uyuni_cert_mail root@localhost Certificate mail
uyuni_cert_o Darmstadt Certificate organization
uyuni_cert_ou Darmstadt Certificate organization unit
uyuni_cert_state Hessen Certificate state
uyuni_cert_pass uyuni Certificate password
uyuni_org_name Demo Organization name
uyuni_org_login admin Organization administrator username
uyuni_org_password admin Organization administrator password
uyuni_org_mail root@localhost Organization administrator mail
uyuni_org_first_name Anton Organization administrator first name
uyuni_org_last_name Administrator Organization administrator last name
uyuni_use_repo true Flag whether official Uyuni repository should be added
uyuni_firewall_config true Flag whether firewalld should be configured
uyuni_firewall_default_zone internal firewalld default zone to set
uyuni_firewall_services ["suse-manager-server"] Firewall services to enable
uyuni_firewall_ports empty Firewall ports to enable (e.g. 8080/tcp)
uyuni_cefs_setup false Flag whether errata for CentOS should be generated via CEFS
uyuni_cefs_setup_cronjob false Flag whether CEFS cronjob should be generated
uyuni_cefs_path /opt/errata-import Path to install CEFS and the wrapper script to
uyuni_channels empty Common channels to synchronize (e.g. centos7 and epel7)
uyuni_sync_channels false Flag whether created channels should be synced
uyuni_bootstrap_repos false Flag whether Salt bootstrap repositories should be created
uyuni_enable_monitoring false Flag whether integrated monitoring stack should be enabled
uyuni_install_monitoring_formulas false Flag whether monitoring Salt Formulas should be installed

When supplying channels to create in channels, ensure passing a list with dicts like this:

- name: centos7
  arch: x86_64
- name: centos7-updates
  arch: x86_64

For available channels and architectures, see the spacewalk-common-channels.ini installed by the spacewalk-utils package. There is also an online version on GitHub.

Dependencies

No dependencies.

Example Playbook

Refer to the following example:

- hosts: servers
  roles:
    - stdevel.uyuni

Set variables if required, e.g.:

---
- hosts: uyuni.giertz.loc
  remote_user: root
  roles:
    - role: stdevel.uyuni
      uyuni_cefs_setup: true
      uyuni_cefs_setup_cronjob: true
      uyuni_channels:
        - name: centos7
          arch: x86_64
        - name: centos7-updates
          arch: x86_64

Don't forget setting SUSE-related variables when deploying SUSE Manager:

- hosts: servers
  roles:
    - role: stdevel.uyuni
      uyuni_scc_reg_code: DERP1337LULZ
      uyuni_scc_mail: [email protected]

If you plan to bootstrap older Uyuni versions, set the Uyuni release:

---
- hosts: retro.giertz.loc
  remote_user: root
  roles:
    - role: stdevel.uyuni
      uyuni_release: '2023.03'

Ensure having all available system updates installed before running the playbook!

Common issues

Error when running the playbook:

TASK [ansible-uyuni : Add Uyuni repositories] ************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named xml.dom.minidom

Install the missing python-xml package.

License

Apache 2.0

Author Information

Christian Stankowic ([email protected])

ansible-uyuni's People

Contributors

stdevel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-uyuni's Issues

Add partition for /var/cache/rhn

Currently, the Ansible role won't automatically create a dedicated /var/cache/rhn partition. This might led into storage problems as at least 20 GB are required.

Add option for release pinning

As older releases are currently mirrored until further notice, it would be an option to add version pinning for installation. Details here: https://build.opensuse.org/project/subprojects/systemsmanagement:Uyuni:Snapshots

Release Date Snapshot Repository
4.0.0 26.10.2018 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:4.0.0 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/4.0.0/images/
4.0.1 19.12.2018 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:4.0.1 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/4.0.1/images/
4.0.2 02.08.2019 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:4.0.2 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/4.0.2/images/
2020.01 31.01.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.01 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2020.01/images/
2020.03 19.03.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.03 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2020.01/images/
2020.04 16.04.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.04 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2020.04/images/
2020.05 21.05.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.05 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2020.05/images/
2020.06 15.06.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.06 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2020.06/images/
2020.07 24.07.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.07 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2020.07/images/
2020.09 22.09.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.09 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2020.09/images/
2020.11 26.11.2020 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2020.11 not available
2021.01 05.02.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.01 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.01/images/
2021.02 01.03.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.02 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.02/images/
2021.04 21.04.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.04 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.04/images/
2021.05 24.05.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.05 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.05/images/
2021.06 24.06.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.06 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.06/images/
2021.08 13.08.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.08 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.08/images/
2021.09 23.09.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.09 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.09/images/
2021.12 09.12.2021 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2021.12 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2021.12/images/
2022.01 26.01.2022 https://build.opensuse.org/project/show/systemsmanagement:Uyuni:Snapshots:2022.01 https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Snapshots:/2022.01/images/

Add support for IBM Power and Z

SUSE Manager can also be installed on IBM Z, it would be great to have support for it. Currently, required SCC modules are hardcoded to x86_64.

It might be sufficient to replace x86_64 in defaults/main.yml with {{ ansible_architecture }} to also allow ppc64le and s390x..

Modules acitivation - python2 for SLES SP4 not possible

Hello Christian,

when installing Suse Manager on SP4, it is not possible to activate the module python2

- name: sle-module-python2
   identifier: "sle-module-python2/{{ ansible_distribution_version }}/{{ ansible_architecture }}"

I have changed it to python3 and it was working.
So, maybe you need to check which SP is installed to put the right python module.

Best regards,
steffen

errata import missing perl dependencies

Since opensuse 15.4 the perl TimeDate module is not installed anymore and also is not available on the default repositories.
To install the missing package we have to add the dedicated perl repo first, then we can install it:

# zypper addrepo https://download.opensuse.org/repositories/devel:languages:perl/15.4/devel:languages:perl.repo
# zypper refresh
# zypper in perl-TimeDate

After that the import will run again

Add option for enabling monitoring

It would be nice to have an option to pre-enable monitoring by installing the following packages:

# zypper in golang-github-prometheus-node_exporter golang-github-wrouesnel-postgres_exporter prometheus-jmx_exporter golang-github-lusitaniae-apache_exporter prometheus-jmx_exporter-tomcat

Maybe there is also a way for enabling monitoring in the WebUI...

Add support for Uyuni 2020.07+ / openSUSE Leap 15 SP2 and SUSE Manager 4.1 / SLES 15 SP2

Currently the pre-requisite check fails:

TASK [stdevel.uyuni : Ensure having 15 SP1 release] ****************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Please upgrade to SP1"}

NOTE: SUSE Manager 4.0.x (based on SLES 15 SP1) is still supported until June 2021.

Implement firewall rules

It would be great to have the possibility to create firewall rules needed for Uyuni:

Port Description
tcp/22 SSH
tcp/80 http
tcp/443 https
tcp/4505 + 4506 Salt
tcp/69 TFTP, optional
tcp/5222 Traditional clients, optional
tcp/5269 Proxy communication, optional

Implement CEFS/DEFS

After implementing content staging (see also issue #3) it would be handy to have the possibility to enable CentOS and Debian errata import. There are two Perl utilities for this.

This requires the following steps:

  • Install requirements (perl, perl-Text-Unidecode)
  • Download and place errata import scripts
  • Create cronjob for downloading/updating errata information

Rename role to uyuni

It would be easier to have the role named "uyuni" instead of "ansible-uyuni".

Implement SUSE Manager support

As Uyuni is the upstream project for SUSE Manager, it would be nice to also have it supported. The package/pattern names are exactly the same.

Needed changes:

  • task to enter registration code
  • ensure having appropriate repository enabled

Add support for JeOS

In accordance with the official documentation it would be good to implement the following "hack" to replace the base product with SUSE Manager:

# rpm -e --nodeps sles-release
# vi /etc/zypp/zypp.conf
...
solver.onlyRequires = false

ESC ZZ
# SUSEConnect -p SUSE-Manager-Server/4.0/x86_64 -r <code> -e <mail>
# SUSEConnect -p sle-module-basesystem/15.1/x86_64
# SUSEConnect -p sle-module-python2/15.1/x86_64
# SUSEConnect -p sle-module-server-applications/15.1/x86_64
# SUSEConnect -p sle-module-web-scripting/15.1/x86_64
# SUSEConnect -p sle-module-suse-manager-server/<productnumber>/x86_64
# ln -s /etc/products.d/SUSE-Manager-Server.prod /etc/products.d/baseproduct
# zypper in yast2-storage-ng

Implement tags

It would be good to tag the particular tasks for easier debugging and skipping.

Add hint about jmespath

The Python package jmespath is required - otherwise the playbook will fail:

ASK [stdevel.uyuni : Register system] *****************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'scc_registration.stdout | from_json | json_query(query_filter) | join | lower != \"registered\"' failed. The error was: You need to install \"jmespath\" prior to running json_query filter\n\nThe error appears to be in '/home/sles/.ansible/roles/stdevel.uyuni/tasks/prepare_sles.yml': line 9, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Register system\n  ^ here\n"}

Use loops for LVM stuff

Currently, the LVM code looks really duplicated (dedicated tasks per LV, filesystem and mount). It would great having a loop for this stuff.

Missing SLE modules

Hi

I have tried installing the SUSE Manager 4.0 using the Ansible.
Encountered error during the installation and found the modules needs to be updated with the following order.
requesting you to kindly update the code base with the changes.

sles_modules:

  - name: sle-module-basesystem
    identifier: sle-module-basesystem/15.1/x86_64
  - name: sle-module-web-scripting
    identifier: sle-module-web-scripting/15.1/x86_64
  - name: sle-module-python2
    identifier: sle-module-python2/15.1/x86_64
  - name: sle-module-suse-manager-server
    identifier: sle-module-suse-manager-server/4.0/x86_64
  - name: sle-module-server-applications
    identifier: sle-module-server-applications/15.1/x86_64
  - name: sle-module-desktop-applications
    identifier: sle-module-desktop-applications/15.1/x86_64
  - name: sle-module-development-tools
    identifier: sle-module-development-tools/15.1/x86_64

SuSEconnect url addition (feature request)

Hi Christian

It would be nice to have a parameter uyuni_scc_url in order to specify URL to use for registration; could be useful e.g. in cloud environments to specify --url=scc.suse.com

Thanks, Dietmar

Add possibility to skip LVM

Some systems don't require a second disk for application data (e.g. temporary Vagrant boxes), so it would be handy having the possibility to skip LVM tasks.

Implement content staging

It would be great to also have the possibility to create software channels via spacewalk-common-channels (from the spacewalk-utils package).

Tasks:

  • install requirements
  • create channels

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.