RedHatGov.openstack_instance

OSP Instance

=========

Create an instance on OpenStack.

Requirements


  • Python version 2.7 or higher
  • OpenStack SDK

Role Variables


Variable Required Default Description
os_auth omit A dictionary with authentication details needed for the cloud. This usually includes auth_url, username, password, project_name, and domain information if applicable. If you use a named cloud or have OS_* environment variables, this is not needed.
os_instance_name The name for the instance.
os_instance_image The name or ID of the base image to use when starting the instance.
os_instance_flavor The name or ID of the flavor for the new instance.
os_instance_key_name The name of the key pair to use when creating the instance.
os_instance_auto_ip yes Ensures the instance has a public IP as determined by the cloud.
os_instance_timeout 300 How long to wait for the instance to become active.
os_instance_volumes [] A list of volumes to create and attach to the instance, each with name and size.
os_instance_security_groups [] Security groups to create and add to the instance, each with name, rules, and optional description. The rules are defined here.

Dependencies


None

Example Playbook


Here’s an example of how to use this role with variables:

- hosts: localhost
  vars:
    os_auth:
      auth_url: http://openstack.example.com:5000
      username: admin
      password: p@ssw0rd
      project_name: demo
      project_domain_name: default
      user_domain_name: default
    project_name: myproject
    os_instance_name: myinstance
    os_instance_image: rhel75
    os_instance_flavor: m4.xlarge
    os_instance_key_name: user1-key
    os_instance_network: private
    os_instance_auto_ip: yes
    os_instance_timeout: 300
    os_instance_volumes:
    - name: scratch
      size: 10
    - name: db
      size: 50
    os_instance_security_groups:
    - name: ssh
      description: Allow SSH
      rules:
        - protocol: tcp
          port_range_min: 22
          port_range_max: 22
          remote_ip_prefix: 0.0.0.0/0
    - name: web
      rules:
        - protocol: tcp
          port_range_min: 80
          port_range_max: 80
          remote_ip_prefix: 0.0.0.0/0
        - protocol: tcp
          port_range_min: 443
          port_range_max: 443
          remote_ip_prefix: 0.0.0.0/0
  tasks:
    - name: Create OpenStack Instance
      include_role:
        name: RedHatGov.openstack_instance

License


GPLv3

Author Information


Red Hat North American Public Sector Solution Architects

Informazioni sul progetto

Create an instance on a OpenStack Cloud

Installa
ansible-galaxy install RedHatGov.openstack_instance
Licenza
gpl-3.0
Download
116
Proprietario
Code contributions from Red Hat's Public Sector practice