GithubHelp home page GithubHelp logo

stdevel / ansible-collection-uyuni Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 6.0 145 KB

Ansible Collection for Uyuni / SUSE Manager

Home Page: https://galaxy.ansible.com/stdevel/uyuni

License: GNU General Public License v3.0

Python 97.41% Shell 1.69% Jinja 0.90%
ansible ansible-collection linux spacewalk suse-manager system-management uyuni

ansible-collection-uyuni's People

Contributors

azrdev avatar mat-ti avatar maxherrmannsva avatar rainerleber avatar stdevel avatar tanganellilore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-collection-uyuni's Issues

Modules should return Uyuni action ID

Currently, the modules won't return the action ID given by the Uyuni task scheduler. Those information might be necessary for debugging purposes.

storage role cannot create xfs filesystems (as xfsprogrs is installed in server role later)

First off, thanks Christian for the collection and the nice SUSECON talk.

I picked up my Uyuni experiments and integrated your collection into my little vagrant setup. I used a playbook like the following:

[...]
  roles:                                                                                                                                                                                     
    - role: 'stdevel.uyuni.storage'                                                                                                                                                          
      uyuni_pv: '/dev/vdb'                                                                                                                                                                   
    - role: 'stdevel.uyuni.server'
      [...]

My guess was that the storage should be prepared first, before installing the server and using the mounts.

But this fails, as xfsprogs is not yet installed when the storage role runs:

TASK [stdevel.uyuni.storage : Create file systems] *****************************
failed: [uyuniserver01] (item={'name': 'lv_uyuni', 'type': 'xfs', 'mountpoint': '/var/spacewalk', 'size': 10240}) => {"ansible_loop_var": "item", "changed": false, "item": {"mountpoint": "/var/spacewalk", "name": "lv_uyuni", "size": 10240, "type": "xfs"}, "msg": "Failed to find required executable \"mkfs.xfs\" in paths: /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin"}
failed: [uyuniserver01] (item={'name': 'lv_pgsql', 'type': 'xfs', 'mountpoint': '/var/lib/pgsql', 'size': 10240}) => {"ansible_loop_var": "item", "changed": false, "item": {"mountpoint": "/var/lib/pgsql", "name": "lv_pgsql", "size": 10240, "type": "xfs"}, "msg": "Failed to find required executable \"mkfs.xfs\" in paths: /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin"}
failed: [uyuniserver01] (item={'name': 'lv_cache', 'type': 'xfs', 'mountpoint': '/var/cache/rhn', 'size': 10240}) => {"ansible_loop_var": "item", "changed": false, "item": {"mountpoint": "/var/cache/rhn", "name": "lv_cache", "size": 10240, "type": "xfs"}, "msg": "Failed to find required executable \"mkfs.xfs\" in paths: /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin"}

Manually installing the xfsprogs package before running the storage role fixes the issue.

I think it would be best to move the xfsprogs installation into the storage role. If desired, I can create a PR for that.

Create dynamic inventory

It woulde be nice having a dynamic inventory that offers the following features:

  • listing hosts and hostgroups
  • listing IPv4/IPv6 addresses
  • listing custom parameters and values

Replace XMLRPC

The new API will be considered as "production ready" with SUMA 4.3.2 so it would be a great option to drop XMLRPC.

Slim-down Uyuni library

Currently, uyuni.py includes a lot of overhead required for katprep - e.g. ABCs, additional classes, plain functions. It would be nice to remove these for the library to become more maintainable.

bootstrap failed because are using http

When I using uyuni collection to bootstrap a few linux servers, AWX show me following error:

"HTTP Error 404: 404", "status_code": 404, "url": "http://myuyunifqdn/pub/bootstrap/bootstrap-oraclelinux8.9.sh"}

looking for uyuni docs and open manually repo bootstrap I saw that URL its working just https but bootstrap.yml (roles/client/tasks/bootstrap.yml) are set to using http

  • name: Download Uyuni bootstrap script
    ansible.builtin.get_url:
    url: "http://{{ uyuni_server }}/pub/bootstrap/{{ uyuni_bootstrap_filename }}"
    dest: "{{ uyuni_bootstrap_folder }}/bootstrap.sh"

Add client role

It would be great to have a client role that bootstraps new clients.

[Dynamic Inventory] Add Custom Hostinfo key filter

It would be nice to have the possibility to filter systems based on their Custom Hostinfo keys, e.g.:

plugin: stdevel.uyuni.inventory
host: 192.168.180.1
user: admin
password: admin
verify_ssl: false
show_custom_values: true
custom_values:
  - katprep_snapshot
  - katprep_virt_snapshot = 1

Add EDA functions

As event-driven Ansible seems to be a real thing, it would be nice to have the possible to leverage it - e.g.

  • listening for systems requiring a reboot
  • listening for systems that are unreachable (e.g. Salt Minion down)

Add option for only installing updates relevant to the package management stack

From time to time there are regression bugs in openSUSE Leap / SLES that result in a orphaned task during patch installation. As a result, the patch task is still in "Scheduled" or "Picked Up" state, even though some patches might have been installed - or not.
It would be good to install all package management stack updates first before installing all remaining patches.

This could be implemented as a parameter for the install_patches module, e.g. mgmt_stack_only.

Unfortunately, there is no API call for this in Uyuni - so we need to be more creative. It could be possible to filter for errata affecting the zypper, libzypp, salt-minion and venv-salt-minion packages.

Add module for waiting until action is finished

For some actions (e.g. installing patches) it is required to wait until they are finished before the next step (e.g. rebooting the host) is executed. For this specific example, we can't rely on the Uyuni task scheduler, as requests are in mixed order sometimes. A module like stdevel.uyuni.wait_for_task could be a benefit.

Requires #37.

Add upgrade role

It would be nice having an Ansible Role for upgrading SUSE Manager - including database migrations.

Allow creating bootstrap scripts and activation keys

Dear Christian,

for a small demo setup I have all the tooling ready to automatically setup the server and bootstrap the client. For now, there is one manual step in between, and that is creating a bootstrap script and an activation key.

I am not sure how much use this would get outside of demos, but I could imaging that this could be a nice addition to your collection.

(Or is this already possible and I just missed it?)

Add testing

It would be nice to implement testing:

  • add example playbooks
  • add Vagrant box for testing
  • add module tests

install_patches error: ... Please consider setting 'allowModules=true'.

I ran the sample ansible playbook install_patches and received the following error from my Uyuni:

...
TASK [Installing patches] ***************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible_collections.stdevel.uyuni.plugins.module_utils.exceptions.SessionException: Generic remote communication error: "redstone.xmlrpc.XmlRpcFault: Operation not allowed for systems that have modular channels assigned. Please consider setting 'allowModules=true'."
...

I tried adding allowModules = True to the API call and it works. Can I contribute code adding this parameter to install_patches?

References: https://github.com/uyuni-project/poc-uyuni-api/blob/master/cmd/mgr-api.spec.conf

Build Content Lifecycle Project

It would be great if the collection could be used to build "Content Lifecycle Projects". I plan an automation to roll out kernel live patches (e.g. monthly). I have predefined filters in my project which allow newly released kernel live patches to be included in a new build. So I need a function to (re-)build the project and promote it to higher stages. After that I can use function the collection already offers to apply the patches.
This should be possible through the [contentmanagement.buildProject] and [contentmanagement.promoteProject] API calls.

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.