forked from codyde/cas-ansible-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnsible and Cloud-init using Ubuntu Cloud Ready OVA.yaml
80 lines (80 loc) · 2.09 KB
/
Ansible and Cloud-init using Ubuntu Cloud Ready OVA.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
inputs:
hostname:
title: Hostname
type: string
password:
type: string
encrypted: true
title: Password
default: VMware123!
resources:
web1:
type: Cloud.Machine
metadata:
layoutPosition:
- 0
- 1
networks:
- name: '${resource.AppNetwork.name}'
properties:
image: Blog Ubuntu 18.04 LTS
constraints:
- tag: 'category:development'
flavor: generic.tiny
cloudConfig: |
#cloud-config
password: 'VMware1!'
chpasswd: { expire: False }
ssh_pwauth: True
users:
- default
- name: 'ansibleoss'
ssh_authorized_keys:
- ssh-rsa changeme ansibleoss@ansibleoss
passwd: ${input.password}
sudo: ['ALL=(ALL) NOPASSWD:ALL']
groups: [wheel, sudo, admin]
shell: '/bin/bash'
lock_passwd: false
preserve_hostname: false
chpasswd:
list: |
ansibleoss:${input.password}
expire: False
hostname: ${input.hostname}
runcmd:
- echo "disable_vmware_customization: false " >> /etc/cloud/cloud.cfg
- sed -i 's/D \/tmp 1777 root root -/#D \/tmp 1777 root root -/g' /usr/lib/tmpfiles.d/tmp.conf
final_message: "The system is ready, after $UPTIME seconds"
hostname: '${input.hostname}'
networks:
- name: '${AppNetwork.name}'
network: '${resource.AppNetwork.id}'
AppNetwork:
type: Cloud.Network
metadata:
layoutPosition:
- 1
- 0
properties:
name: vDSVlan629
networkType: existing
Ansbile:
type: Cloud.Ansible
metadata:
layoutPosition:
- 0
- 0
properties:
inventoryFile: /etc/ansible/hosts
username: ansibleoss
playbooks:
provision:
- /home/ansibleoss/playbooks/cas-ansible-demo/playbook/nginx-playbook.yml
osType: linux
groups:
- Blog
maxConnectionRetries: 10
host: '${resource.web1.*}'
account: dg-blog-ansibleoss
privateKeyFile: ~/.ssh/id_rsa