morpheus数据的ansible模
ansible-modules-morpheus的Python项目详细描述
Ansible模块Morpheus
安装此模块:
- 通过
pip
pipinstallansible-modules-morpheus
- 通过
ansible-galaxy
ansible-galaxyinstall'git+https://github.com/gomorpheus/ansible-modules-morpheus.git'
环境变量
如果您选择使用env vars,可以将以下变量导出到您使用ansible控制的环境中,以便向您的morpheus设备进行身份验证:
- morpheus设备的url
- morph_authType:morpheus的授权类型(令牌或用户密码)
- morph_user:userpass authType的morpheus设备用户名
- morph_password:用于userpass authType的morpheus设备用户密码
- morph_token:用于token authType的morpheus api令牌
- morf_ssl_verify:用于验证ssl的布尔值
特定模块的附加变量:
- morph_secret:morpheus密码值的密钥在morph_cypher模块中读取
参数
或者,可以通过在任务模块中使用离散变量将参数传递给模块。支持的参数是:
- baseurl:morpheus设备的url
- authType:Morpheus的授权类型(令牌或用户密码)
- api_令牌:用于令牌authType的morpheus api令牌
- username:morpheus设备username for userpass authType
- 密码:用于userpass authType的Morpheus设备用户密码
- ssl_verify:用于验证ssl的布尔值
对于特定模块
- secret_key:morpheus secret key for cypher value reads in morph_cypher module
模块示例
变形机
-hosts:footasks:-name:gettokenmorph_cypher:baseurl:"https://sandbox.morpheusdata.com"secret_key:"password/spark"authtype:tokenssl_verify:Falseregister:results-debug:var=results.secret
或者显式地将api_令牌作为变量传递:
-hosts:footasks:-name:gettokenmorph_cypher:baseurl:"https://sandbox.morpheusdata.com"secret_key:"secret/nooneknows"authtype:tokenapi_token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"register:results
查找插件示例
变形机
-debug:msg:"{{ lookup('morph_cypher', 'baseurl=https://sandbox.morpheusdata.com authtype=token api_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx secret_key=password/spark')}}"-debug:msg:"{{ lookup('morph_cypher', 'baseurl=https://sandbox.morpheusdata.com authtype=userpass username=slim_shady password=password secret_key=secret/hello') }}"-debug:msg:"{{ lookup('morph_cypher', 'baseurl=https://sandbox.morpheusdata.com authtype=token api_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ssl_verify=False secret_key=key/256/myKey') }}"