There are several options for configuring blueprints to support Puppet based configuration management on vCenter compute resources.

Puppet on vSphere with Username and Password Authentication

The following example shows example YAML code for Puppet on a vSphere OVA with username and password authentication.

Table 1.

Example of...

Sample Blueprint YAML

YAML code for Puppet on a vSphere OVA with username and password authentication.

inputs:
  username:
    type: string
    title: Username
    default: puppet
  password:
    type: string
    title: Password
    encrypted: true
    default: VMware@123
resources:
  Puppet_Agent:
    type: Cloud.Puppet
    properties:
      provider: PEonAWS
      environment: dev
      role: 'role::linux_webserver'
      username: '${input.username}'
      password: '${input.password}'
      useSudo: true
      host: '${Webserver.*}’
      osType: linux
      agentConfiguration:
        runInterval: 15m
        certName: ‘${Machine.address}'
  Webserver:
    type: Cloud.vSphere.Machine
    properties:
      cpuCount: 1
      totalMemoryMB: 1024
      imageRef: >-
https://cloud-images.ubuntu.com/releases/16.04/release-20170307/ubuntu-16.04-server-cloudimg-amd64.ova
      cloudConfig: |
        #cloud-config
        ssh_pwauth: yes
        chpasswd:
          list: |
            ${input.username}:${input.password}
          expire: false
        users:
          - default
          - name: ${input.username}
            lock_passwd: false
            sudo: ['ALL=(ALL) NOPASSWD:ALL']
            groups: [wheel, sudo, admin]
            shell: '/bin/bash'
            ssh-authorized-keys:
              - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDytVL+Q6+vGbmkXoRpX dmettem@dmettem-m01.vmware.com
        runcmd:
          - echo "Defaults:${input.username}

YAML code for Puppet on a vSphere OVA with username and password authentication on the compute resource.

inputs:
  username:
    type: string
    title: Username
    default: puppet
  password:
    type: string
    title: Password
    encrypted: true
    default: VMware@123
resources:
  Puppet_Agent:
    type: Cloud.Puppet
    properties:
      provider: PEonAWS
      environment: dev
      role: 'role::linux_webserver'
      username: '${input.username}'
      password: '${input.password}'
      useSudo: true
      host: '${Webserver.*}’
      osType: linux
      agentConfiguration:
        runInterval: 15m
        certName: ‘${Machine.address}'
  Webserver:
    type: Cloud.vSphere.Machine
    properties:
      cpuCount: 1
      totalMemoryMB: 1024
      imageRef: >-
https://cloud-images.ubuntu.com/releases/16.04/release-20170307/ubuntu-16.04-server-cloudimg-amd64.ova
      cloudConfig: |
        #cloud-config
        ssh_pwauth: yes
        chpasswd:
          list: |
            ${input.username}:${input.password}
          expire: false
        users:
          - default
          - name: ${input.username}
            lock_passwd: false
            sudo: ['ALL=(ALL) NOPASSWD:ALL']
            groups: [wheel, sudo, admin]
            shell: '/bin/bash'
            ssh-authorized-keys:
              - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDytVL+Q6+vGbmkXoRpX dmettem@dmettem-m01.vmware.com
        runcmd:
          - echo "Defaults:${input.username}

YAML code for Puppet on a vCenter with remote access enabled password authentication on the compute resource.

inputs:
  username:
    type: string
    title: Username
    description: Username to use to install Puppet agent
    default: puppet
  password:
    type: string
    title: Password
    default: VMware@123
    encrypted: true
    description: Password for the given username to install Puppet agent
resources:
  Puppet-Ubuntu:
    type: Cloud.vSphere.Machine
    properties:
      flavor: small
      imageRef: >-
        https://cloud-images.ubuntu.com/releases/16.04/release-20170307/ubuntu-16.04-server-cloudimg-amd64.ova
      remoteAccess:
        authentication: usernamePassword
        username: '${input.username}'
        password: '${input.password}'
  Puppet_Agent:
    type: Cloud.Puppet
    properties:
      provider: PEMasterOnPrem
      environment: production
      role: 'role::linux_webserver'
      username: '${input.username}'
      password: '${input.password}'
      host: '${Puppet-Ubuntu.*}'
      useSudo: true
      agentConfiguration:
        certName: '${Puppet-Ubuntu.address}'

Puppet on vSphere with generatedPublicPrivateKey Authentication

Table 2.

Example of...

Sample Blueprint YAML

YAML code for Puppet on a vSphere OVA with generatedPublicPrivateKey authentication on the compute resource.

inputs: {}
resources:
  Machine:
    type: Cloud.vSphere.Machine
    properties:
      flavor: small
      imageRef: >-
https://cloud-images.ubuntu.com/releases/16.04/release-20170307/ubuntu-16.04-server-cloudimg-amd64.ova
      remoteAccess:
        authentication: generatedPublicPrivateKey
  Puppet_Agent:
    type: Cloud.Puppet
    properties:
      provider: puppet-BlueprintProvisioningITSuite
      environment: production
      role: 'role::linux_webserver'
      host: '${Machine.*}’
      osType: linux
      username: ubuntu
      useSudo: true
      agentConfiguration:
        runInterval: 15m
        certName: ‘${Machine.address}'
          - echo "Defaults:${input.username}