Giter Site home page Giter Site logo

ansible-openstack-instance's Introduction

OSP Instance

Create an instance on OpenStack.

Requirements

  • python >= 2.7
  • openstacksdk

Role Variables

Variable Required Default Description
os_auth ✔️ omit Dictionary containing auth information as needed by the cloud's auth plugin strategy. For the default password plugin, this would contain auth_url, username, password, project_name and any information about domains if the cloud supports them. For other plugins, this param will need to contain whatever parameters that auth plugin requires.

This parameter is not needed if a named cloud is provided or OpenStack OS_* environment variables are present.
os_instance_name ✔️ Name that has to be given to the instance.
os_instance_image ✔️ The name or id of the base image to boot.
os_instance_flavor ✔️ The name or id of the flavor in which the new instance has to be created.
os_instance_key_name ✔️ The key pair name to be used when creating a instance.
os_instance_auto_ip yes Ensure instance has public ip however the cloud wants to do that.
os_instance_timeout 300 The amount of time the module should wait for the instance to get into active state.
os_instance_volumes [] A list of volumes to create and attach to the instance. Each volume in the list would contain name and size.
os_instance_security_groups [] The security groups to create and to which the instance should be added. Each security group in the list would contain name, rules, and optionally description.

The rules parameter would contain options defined here.

Dependencies

None

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.