Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
heat_template_version: 2013-05-23
description: HOT template to deploy an emerginov compact machine
parameters:
password:
type: string
description: SSH password
resources:
security_group:
type: OS::Neutron::SecurityGroup
properties:
name: emerginov-sg
description: Emerginov Security Group
rules:
- protocol: icmp
- protocol: tcp
port_range_min: 22
port_range_max: 22
- protocol: tcp
port_range_min: 80
port_range_max: 80
- protocol: tcp
port_range_min: 443
port_range_max: 443
- protocol: tcp
port_range_min: 5060
port_range_max: 5060
- protocol: udp
port_range_min: 5060
port_range_max: 5060
- protocol: udp
port_range_min: 20000
port_range_max: 20999
cloud_config:
type: OS::Heat::CloudConfig
properties:
cloud_config:
password: { get_param: password }
chpasswd: { expire: False }
ssh_pwauth: True
hostname: compact
fqdn: dev.breizhinnov.fr
manage_etc_hosts: false
runcmd:
- [ sh, -c, "hostname compact"]
- [ sh, -c, "ip a l eth0 |grep ' inet ' | awk '{print $2}' | awk -F '/' '{print $1}'>/tmp/ip"]
- [ sh, -c, "echo \"$(cat /tmp/ip) svn.dev.breizhinnov.fr # Added by cloud-init\" >>/etc/hosts"]
- [ sh, -c, "sed -r -i \"s/192.168.3.78/$(cat /tmp/ip)/g\" /etc/emerginov/emerginov.pp"]
- [ sh, -c, "sed -r -i 's/161.105.252.112/84.39.33.168/g' /etc/emerginov/emerginov.pp"]
- [ sh, -c, "sed -r -i 's/dev.opensteak.fr/dev.breizhinnov.fr/g' /etc/emerginov/emerginov.pp"]
- [ sh, -c, "cp /etc/puppet/fileserver.conf.sample /etc/puppet/fileserver.conf"]
- [ sh, -c, "sed -r -i 's/__DOMAIN__/dev.breizhinnov.fr/g' /etc/puppet/fileserver.conf"]
- [ sh, -c, "mkdir -p /etc/puppet/files/certs/dev.breizhinnov.fr/dev.breizhinnov.fr"]
- [ sh, -c, "service puppetmaster restart"]
- [ sh, -c, "emerginov-apply"]
- [ sh, -c, "emerginov-apply"]
- [ sh, -c, "service redis-server restart"]
final_message: "The emerginov is finally up, after $UPTIME seconds. Please browse: http://www.dev.breizhinnov.fr/"
server1:
type: OS::Nova::Server
properties:
name: emerginov-compact
image: 0c080dd7-463d-4172-b86d-dae6d24bf837
flavor: 17
security_groups:
- {get_resource: security_group}
networks:
- port: { get_resource: server1_port }
user_data_format: RAW
user_data:
get_resource: cloud_config
server1_port:
type: OS::Neutron::Port
properties:
network_id: 9092e21f-71f8-4050-bb6a-36fb27ea959e
fixed_ips:
- subnet_id: 977e6646-2ca3-44d9-a6c7-9f1723fd36c2
outputs:
server1_provider_ip:
description: IP address of emerginov-compact in provider network
value: { get_attr: [ server1, first_address ] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.