Git Product home page Git Product logo

ansible-cloudbuilder's Introduction

Cloudbuilder

This is a roles for provisioning clouds nodes/vpcs/vnets. It takes a model and creates that architecture in the cloud provider specified by that blueprint.

Requirements

These playbooks assume that you have your cloud environment setup correctly for authentication. For example, boto is required for AWS.

Role Variables

  • cloud_model: The cloud model that you want to deploy into the specified cloud provider (required)
  • cloud_project: The name of the overall project. (DEFAULT: username)
  • cloud_instance: The specific instance of the overall project. (DEFAULT: cloud_model)
  • cloud_provider: The cloud provider in which to deploy the model. (DEFAULT: aws)
  • cloud_region: The region of the cloud provider in which to deploy the model (DEFAULT: us-east-1)
  • cloud_cidr : The private subnet for the deployment in CIDR notation.
  • cloud_site_number: The site number (DEFAULT: 0)
  • cloud_key_name: The name of the key used/created (DEFAULT: username)
  • cloud_public_key_file: The name of the file containing the public key
  • cloud_inventory_root: The root where the inventories will be created (DEFAULT: ./inventory)
  • cloud_inventory_dir: The directory where the inventory files will be created (DEFAULT: cloud_inventory_root/cloud_project)
  • cloud_inventory_file: The name of the inventory file (DEFAULT: cloud_inventory_dir/cloud_instance)

Dependencies

None.

Example Playbook

- hosts: localhost
  connection: local
  gather_facts: no
  tasks:
    - assert:
        that:
          - cloud_model is defined
        msg: "You must specify a model, e.g. -e 'cloud_model=csr-spoke1.yml'"

    - include_role:
        name: cloudbuilder
        tasks_from: build
      tags:
        - build

    - include_role:
        name: cloudbuilder
        tasks_from: facts
      tags:
        - facts

    - debug: var=hostvars

    - include_role:
        name: cloudbuilder
        tasks_from: inventory
      tags:
        - inventory

        ## Cloud Models

        The cloud model is a cloud-agnostic data model that describes the particlar cloud deployment.  It creates the container network (e.g. VPC), the subnets, adds routes, security groups, etc.  It also contains instances, but this is mainly to deploy VNFs and service nodes.

        ### Cloud Model Example

            cloud_acls:
              host-acl:
                - { src_ip: 0.0.0.0/0, dst_ports: 22, proto: tcp }
                - { src_ip: 0.0.0.0/0, dst_ports: 443, proto: tcp }
                - { src_ip: 0.0.0.0/0, proto: icmp }
              rtr-acl:
                - { src_ip: 0.0.0.0/0, proto: all }
            vpc_list:
              - name: "{{ cloud_name }}"
                provider: "{{ cloud_provider }}"
                region: "{{ cloud_region }}"
                project: "{{ cloud_name }}"
                cidr: "{{ cloud_cidr }}"
                networks:
                  - name: "outside.{{ cloud_name }}"
                    cidr: "{{ cloud_cidr | ipsubnet(24, 0) }}"
                    az: "{{ cloud_region }}a"
                  - name: "inside.{{ cloud_name }}"
                    cidr: "{{ cloud_cidr | ipsubnet(24, 1) }}"
                    az: "{{ cloud_region }}a"
                    routes:
                      - cidr: "0.0.0.0/0"
                        instance: "rtr1.{{ cloud_name }}"
                        if_index: 2
                instances:
                  - name: "rtr1.{{ cloud_name }}"
                    size: medium
                    image: csr-byol
                    interfaces:
                      - name: GigabitEthernet1
                        subnet: "outside.{{ cloud_name }}"
                        acl: rtr-acl
                        public_ip: true
                        private_ip: "{{ cloud_cidr | ipsubnet(24, 0) | ipaddr(-2) | ipaddr('address') }}"
                      - name: GigabitEthernet2
                        subnet: "inside.{{ cloud_name }}"
                        acl: rtr-acl
                        public_ip: true
                        private_ip: "{{ cloud_cidr | ipsubnet(24, 1) | ipaddr(-2) | ipaddr('address') }}"
                    tags:
                      network_os: ios
                      groups: network,routers,spoke_routers
                    user_data: "{{ lookup('file', 'csr.user_data') }}"
                  - name: "host1.{{ cloud_name }}"
                    size: micro
                    image: rhel7
                    interfaces:
                      - name: eth0
                        subnet: "inside.{{ cloud_name }}"
                        acl: host-acl
                        private_ip: "{{ cloud_cidr | ipsubnet(24, 2) | ipaddr(10) | ipaddr('address') }}"
                    tags:
                      groups: hosts

License

GPL-3

Author Information

  • Steven Carter

ansible-cloudbuilder's People

Contributors

ismc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

marcosgm

ansible-cloudbuilder's Issues

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.