Skip to content

kjw3/ansible-proxmox-vm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSP Instance

Create a vm on Proxmox.

Requirements

  • python >= 2.6
  • proxmoxer

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.
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_network ✔️ Name or ID of a network to attach this instance to.
os_instance_auto_ip omit Ensure instance has public ip however the cloud wants to do that.
os_instance_timeout omit The amount of time the module should wait for the instance to get into active state.
os_instance_terminate_volume omit If yes, delete volume when deleting instance (if booted from volume).
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: servers
  roles:
    - role: proxmox_vm
      os_auth:
        auth_url: http://openstack.example.com:5000
        username: admin
        password: p@ssw0rd
        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

License

GPLv3

About

Provision a VM on ProxMox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published