mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
127 lines
3.2 KiB
YAML
127 lines
3.2 KiB
YAML
AnsiblePlaybook:
|
|
type: object
|
|
description: AnsiblePlaybook实例
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: 实例uuid
|
|
readOnly: true
|
|
name:
|
|
type: string
|
|
description: 实例名称
|
|
inventory:
|
|
type: array
|
|
description: 被操作主机列表
|
|
items:
|
|
$ref: "#/AnsiblePlaybookInventoryHost"
|
|
modules:
|
|
type: array
|
|
description: playbook任务列表
|
|
items:
|
|
$ref: "#/AnsiblePlaybookModule"
|
|
files:
|
|
type: object
|
|
description: |
|
|
Ansible执行时所需的文件名称和对应内容
|
|
example:
|
|
influxdb/influxdb.conf.j2: xxx
|
|
kapacitor/kapacitor.conf.j2: xxx
|
|
output:
|
|
type: string
|
|
description: ansibleplaybook执行记录
|
|
start_time:
|
|
type: string
|
|
description: playbook执行开始时间
|
|
format: date-time
|
|
end_time:
|
|
type: string
|
|
description: playbook执行结束时间
|
|
format: date-time
|
|
status:
|
|
type: string
|
|
description: playbook当前执行状态
|
|
enum:
|
|
- running
|
|
- succeeded
|
|
- failed
|
|
- canceled
|
|
- unknown
|
|
|
|
AnsiblePlaybookInventoryHost:
|
|
type: object
|
|
description: Ansible Playbook Inventory主机描述
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: |
|
|
被操作目标主机描述
|
|
|
|
支持以下几种类型,格式描述如下
|
|
|
|
- 云平台虚机id或名称:[server:]name-or-id
|
|
- 指定云平台宿主机:host:name-or-id
|
|
- 非纳管的机器,直接指定IP地址
|
|
|
|
若通过直接指定IP地址的方式尝试对非纳管的机器进行操作,对于目标机器有以下要求
|
|
|
|
- ansibleserver服务能够访问目标机器
|
|
- 目标机器
|
|
- 安装了OpenSSH和Python
|
|
- 存在用户`cloudroot`
|
|
- 能够通过管理员或项目ssh pubkey免密登录cloudroot
|
|
- 若需要`ansible_become`,则要求cloudroot用户能够免密使用sudo
|
|
|
|
举例
|
|
|
|
- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
- host:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
- 10.168.222.236
|
|
|
|
指定云平台虚机或宿主机时,后端会取相应的内网IP地址对其进行访问
|
|
example: server:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
vars:
|
|
type: object
|
|
description: 键值方式描述该主机相关的参数
|
|
example:
|
|
ansible_become: yes
|
|
|
|
AnsiblePlaybookModule:
|
|
type: object
|
|
description: Ansible Playbook Module描述
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: ansible模块名称
|
|
args:
|
|
type: array
|
|
description: ansible模块参数描述
|
|
items:
|
|
type: string
|
|
example:
|
|
name: package
|
|
args:
|
|
- name=nginx
|
|
- state=installed
|
|
|
|
AnsiblePlaybookCreateRequest:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: playbook名称
|
|
ansibleplaybook:
|
|
$ref: '#/AnsiblePlaybook'
|
|
AnsiblePlaybookListResponse:
|
|
type: object
|
|
properties:
|
|
ansibleplaybooks:
|
|
type: array
|
|
items:
|
|
$ref: '#/AnsiblePlaybook'
|
|
AnsiblePlaybookResponse:
|
|
type: object
|
|
properties:
|
|
ansibleplaybook:
|
|
type: object
|
|
$ref: '#/AnsiblePlaybook'
|