Commits vergleichen

...

3 Commits

Autor SHA1 Nachricht Datum
Sebastian Tobie 527ad350cf moved the package to ansible 2023-12-09 13:28:26 +01:00
Sebastian Tobie 5efc47cccc fixed formatting 2023-12-09 13:06:45 +01:00
Sebastian Tobie a66f30ebad updated makefile 2023-12-09 13:06:17 +01:00
6 geänderte Dateien mit 20 neuen und 10 gelöschten Zeilen

2
.gitignore vendored
Datei anzeigen

@ -162,4 +162,4 @@ cython_debug/
# ---> Ansible
*.retry
*.tar.gz

Datei anzeigen

@ -19,4 +19,4 @@ New Plugins
Inventory
~~~~~~~~~
- sebastian.netcup.scp - Returns Ansible inventory from netcup SCP
- ansible.netcup.scp - Returns Ansible inventory from netcup SCP

Datei anzeigen

@ -6,7 +6,10 @@ changelog:
antsibull-changelog generate
docs: format
./update_doc
update-doc
release: changelog docs
ansible-galaxy collection build
upload:
./upload.sh

Datei anzeigen

@ -1,5 +1,5 @@
---
namespace: sebastian
namespace: ansible
name: netcup
version: 0.1.0
readme: README.md

Datei anzeigen

@ -1,13 +1,14 @@
from ansible.plugins.inventory import BaseInventoryPlugin
from xmlrpc.client import ServerProxy
from ansible.inventory.data import InventoryData
from ansible.parsing.dataloader import DataLoader
from xmlrpc.client import ServerProxy
from zeep import Client, Settings
from ansible.plugins.inventory import BaseInventoryPlugin
from ansible.utils.display import Display
from zeep import Client, Settings
display = Display()
class InventoryModule(BaseInventoryPlugin):
NAME = "sebastian.netcup.scp"
loader: DataLoader
@ -59,7 +60,7 @@ class InventoryModule(BaseInventoryPlugin):
inventory.set_variable(nickname, "up", serverinfo["status"] == "online")
DOCUMENTATION = r'''
DOCUMENTATION = r"""
name: sebastian.netcup.scp
plugin_type: inventory
short_description: Returns Ansible inventory from netcup SCP
@ -78,4 +79,4 @@ DOCUMENTATION = r'''
- API password to authenticate againt the api.
- This is different from you SCP password and must be set indipendently from the SCP password
required: true
'''
"""

6
upload.sh Ausführbare Datei
Datei anzeigen

@ -0,0 +1,6 @@
#!/bin/bash
user=$(yq -r .namespace galaxy.yml)
package=$(yq -r .name galaxy.yml)
version=$(yq -r .version galaxy.yml)
printf "Namespace: %s\nPackage: %s\nVersion: %s\nfile name: %s\n" $user $package $version "$user-$package-$version.tar.gz"
curl -u sebastian --upload-file "${user}-${package}-${version}.tar.gz" "https://gitea.sebastian-tobie.de/api/packages/${user}/generic/${package}/${version}/${user}-${package}-${version}.tar.gz"