shterm.appmgr_lookup_plugin

appmgr_lookup_plugin

appmgr_lookup_plugin um die echten Kontoinformationen und das Passwort von shterm-appmgr abzurufen.

Anforderungen

  1. shterm-agent
  2. shterm-appmgr

Installation

Installieren Sie die Rolle appmgr_lookup_plugin mit folgendem Befehl:

$ ansible-galaxy install shterm.appmgr_lookup_plugin

Verwendung des Plugins

  • Beispiel für ein Playbook
- hosts: server1
  roles:
    - role: shterm.appmgr_lookup_plugin         
  vars:
     contents: "{{lookup('appmgr_lookup_plugin',{'appid':'centos', 'query':'username=root;resourceName=host;reason=test;', 'extra':''})}}"
     ansible_ssh_pass: "{{contents.password}}"
     ansible_ssh_user: "{{contents.name}}"
  tasks:
    - debug: msg="Der Wert von foo.txt ist {{contents.name}}"
  • Beispiel für eine Host-Datei
[demo]
server1 ansible_ssh_host=10.10.20.29 ansible_ssh_pass="{{content.password}}" 
[demo:vars]
content="{{lookup('appmgr_lookup_plugin',{'appid':'centos', 'query':'username=root;resourceName=host;reason=test;', 'extra':''})}}"
  • Beispiel für einen Befehl
ansible 10.10.20.29 -i 10.10.20.29, --playbook-dir ~/.ansible/roles/shterm.appmgr_lookup_plugin/ -u root -e ansible_password="{{lookup('appmgr_lookup_plugin',{'appid':'centos', 'query':'username=root;resourceName=host;reason=test;', 'extra':''}).password}}"  -a 'echo dial'

Plugin-Argumente

  • appid (str): Definiert die eindeutige ID der Anwendung, die die Passwortanforderung stellt.
  • query (str): Beschreibt die Filterkriterien für den Passwortabruf.
  • extra (str): Erweiterungsfeld

Rückgabe des Plugins

  • dict: Ein Wörterbuch mit 'password' und 'name'

Lizenz

MIT

Autoreninformationen

Über das Projekt

Provides access to appmgr variables through a lookup plugin

Installieren
ansible-galaxy install shterm.appmgr_lookup_plugin
GitHub Repository
Lizenz
other
Downloads
151
Besitzer