synnefo-iaas节点的动态可扩展库存
snfinv的Python项目详细描述
snfinv是一个简单的虚拟机配置和动态ansible 用于synnefo iaas部署的清单工具。
安装
使用pip安装
$ pip install snfinv
供应
创建inventory.yml并定义节点配置:
provision: networks: priv1: type: MAC_FILTERED cidr: 10.12.21.0/24 coreos_node1: project: xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx flavour: cpu: 2 ram: 1024 disk: 10 image: b9236d02-0904-4d00-8967-3279f0053d18 // CoreOS image floating_ips: [auto, 83.212.221.53] groups: ['sql'] keys: ['/home/user/.ssh/id_rsa.pub'] users: ['core'] networks: priv1: ip: 10.12.21.1 vars: ansible_var1: 'value' coreos_node2: project: xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx flavour: cpu: 2 ram: 1024 disk: 10 image: b9236d02-0904-4d00-8967-3279f0053d18 // CoreOS image floating_ips: [auto] groups: ['web'] keys: ['/home/user/.ssh/id_rsa.pub'] users: ['core'] networks: priv1: ip: 10.12.21.1 vars: ansible_var1: 'value'
然后,您可以通过在目录中运行来提供上述规范 以上文件已创建:
$ snfinv --provision< P>脚本是可重入的,它不会试图重建现有资源。 但它不够聪明,无法巧妙地重新组装脆弱的配置 更改,如更改vm风格/ips/keys等。
责任库存
snfinv工具提供所需的命令行界面,以便能够使用 是一个动态可转移库存:
$ ansible `which snfinv` "coreos_node2" -m shell -a ls
其他参数
–干燥
与条款结合使用。如果设置,则不会向 synnefo api终结点。
–列出主机
输出可用节点的友好列表。
–config=<;库存路径。yml>;
提供自定义的inventory.yml文件。默认情况下使用/inventory.yml。 snfinv_config环境变量也可用于声明路径 设置配置文件。
–kamaki配置
为kamaki配置文件使用自定义位置。