-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple_node.yaml.original
More file actions
81 lines (69 loc) · 2.26 KB
/
Copy pathsimple_node.yaml.original
File metadata and controls
81 lines (69 loc) · 2.26 KB
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
heat_template_version: 2013-05-23
parameters:
name:
type: string
label: instance name
ipaddr:
type: string
label: server ip
public_key:
type: string
label: public key
private_key:
type: string
label: private key
key:
type: string
label: key name
ipaddr:
type: string
label: consul server ip
resources:
node_instance_port0:
type: OS::Neutron::Port
properties:
network: private_static
node_instance_port1:
type: OS::Neutron::Port
properties:
network: private
instance:
type: OS::Nova::Server
properties:
name: { get_param: name }
flavor: m1.medium
image: centos-6.6-x86_64
key_name: { get_param: key }
personality:
/root/.ssh/coms_rsa: { get_param: private_key }
networks:
- port: { get_resource: node_instance_port0 }
- port: { get_resource: node_instance_port1 }
user_data_format: RAW
user_data:
str_replace:
template: |
#!/bin/bash
chmod 0700 /root/.ssh/coms_rsa
echo $PUBLIC_KEY >> /home/centos/.ssh/authorized_keys
echo "$SERVER_IP consul0" | sudo tee --append /etc/hosts 2> /dev/null
echo "$OWN_IP $HOSTNAME" | sudo tee --append /etc/hosts 2> /dev/null
hostname $HOSTNAME
TMP_PATH=`mktemp -d`
mkdir -p /etc/puppet/hiera
git clone https://github.com/thbeh/puppetfiles.git $TMP_PATH
cp -R $TMP_PATH/puppet/* /etc/puppet/
cp -R $TMP_PATH/hiera/hiera.yaml /etc/puppet/
cp -R $TMP_PATH/hiera/* /etc/puppet/hiera/
echo "server_ip: \"$SERVER_IP\"" | sudo tee --append /etc/puppet/hiera/common.yaml 2> /dev/null
cat << EOF >> /etc/puppet/site.pp
class { 'jdk_oracle':
version => "7"
}
EOF
puppet apply /etc/puppet/site.pp
params:
$PUBLIC_KEY: { get_param: public_key }
$SERVER_IP: { get_param: ipaddr }
$HOSTNAME: {get_param: name }
$OWN_IP: { get_attr: [ node_instance_port1, fixed_ips, 0, ip_address ] }