GithubHelp home page GithubHelp logo

mikaelsmith / bolt-provisioning-example Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 25 KB

Example of provisioning VMs with Bolt and the azure_arm module

License: Apache License 2.0

Ruby 5.31% Puppet 88.25% Pascal 6.45%

bolt-provisioning-example's Introduction

Setup

Setup Azure

Sign up for an Azure account

Install the Azure CLI, then login and initialize providers we'll use with

az login
az provider register --namespace Microsoft.Storage
az provider register --namespace Microsoft.Network
az provider register --namespace Microsoft.Compute

Setup Local Credentials

Set environment variables and create a service principal (jq makes this easier)

export azure_subscription_id=$(az account show | jq -r .id)
export azure_tenant_id=$(az account show | jq -r .tenantId)
azure_client_name=<name>
export azure_client_secret=<password>
az ad sp create-for-rbac --name $azure_client_name --password $azure_client_secret
export azure_client_id="http://${azure_client_name}"

Install Dependencies

Install the azure_arm module with

bolt puppetfile install

Puppet Agent must be installed on the host you use to run Bolt.

Create some VMs

Note: this plan requires Bolt 1.7+

Run the plan

bolt plan run example admin_user=testAdmin admin_password=<make-a-password>

Note: you can pass arguments via a file to prevent them appearing in your shell history.

The plan will wait until machines are provisioned and print their hostnames. You can also get their IP addresses and run more commands directly with Bolt

ipaddresses=$(az vm list-ip-addresses | jq -r '.[].virtualMachine.network.publicIpAddresses[].ipAddress')
bolt command run hostname -n $ipaddresses --transport winrm --user testAdmin --no-ssl --password

bolt-provisioning-example's People

Contributors

mikaelsmith avatar

Stargazers

Neil Galvin avatar

Watchers

Neil Galvin avatar James Cloos avatar  avatar

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.