inputs:
username:
type: string
title: Username
default: puppet
password:
type: string
title: Password
encrypted: true
default: VMware@123
resources:
Webserver:
type: Cloud.AWS.EC2.Instance
properties:
flavor: small
image: centos
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} !requiretty" >> /etc/sudoers.d/${input.username}
Puppet_Agent:
type: Cloud.Puppet
properties:
provider: PEOnAWS
environment: production
role: 'role::linux_webserver'
host: '${Webserver.*}'
osType: linux
username: '${input.username}'
password: '${input.password}'
useSudo: true |