Skip to content

OpenStack

clouds.yaml

Use clouds.yaml instead of sourcing .openrc. see http://docs.openstack.org/developer/os-client-config

$HOME/.config/openstack/cloud.yaml
---

clouds:
  dev:
    auth:
      auth_url: http://cloud.example:5000/v3/
      project_name: ansible
      domain: ansible
      username: ansible
      password: 4ns1ble
    region_name: Region1
  devadm:
    auth:
      auth_url: http://cloud.example:5000/v3/
      project_name: admin
      domain: Default
      username: admin
      password: admin
    region_name: Region1
  fancycloud:
    auth:
      auth_url: http://another.fancy.cloud.example:5000/v3/
      project_name: der-jd
      username: jd
      password: jd
    region_name: Region42
  [...]

openstack cli

Use cloud-config with --os-cloud option.

openstack --os-cloud dev server list
openstack --os-cloud devadm server list
openstack --os-cloud fancycloud server list

ansible

Use it with ansible:

- hosts: localhost
  tasks:
    - name: instance with cloud.yaml
      os_server:
        cloud: fancycloud
        image: Debian 9
        name: example-instance1
        key_name: ansible
        availability_zone: nova
        flavor: tasty42
        network: jd-net

Last update: May 2, 2020

Comments