Merge "Update default template for usage of userdata"

This commit is contained in:
Jenkins 2016-10-04 14:22:07 +00:00 committed by Gerrit Code Review
commit 9555833963
2 changed files with 68 additions and 9 deletions

View File

@ -0,0 +1,50 @@
| # All the data below will be stored as a string object
#cloud-config, see http://cloudinit.readthedocs.io/en/latest/topics/examples.html
ssh_pwauth: True
users:
- name: vagrant
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
chpasswd:
list: |
vagrant:vagrant
expire: False
bootcmd:
# Block access to SSH while node is preparing
- cloud-init-per once sudo iptables -A INPUT -p tcp --dport 22 -j DROP
runcmd:
# Prepare network connection
- sudo ifup {interface_name}
- sudo route add default gw {gateway} {interface_name}
- sudo ifup ens4
- sudo ifup ens5
# Prepare necessary packages on the node
- sudo apt-get update
- sudo apt-get upgrade -y
- sudo apt-get install -y git python-setuptools python-dev python-pip gcc libssl-dev libffi-dev vim software-properties-common
- sudo apt-get autoremove -y
- sudo pip install -U setuptools pip
- sudo pip install 'cryptography>=1.3.2'
- sudo pip install 'cffi>=1.6.0'
# Node is ready, allow SSH access
- sudo iptables -D INPUT -p tcp --dport 22 -j DROP
write_files:
- path: /etc/network/interfaces.d/99-fuel-ccp-tests.cfg
content: |
auto ens3
iface ens3 inet dhcp
auto ens4
iface ens4 inet dhcp
# 3rd interface should be UP without IP address
auto ens5
iface ens5 inet manual
pre-up ifconfig $IFACE up
post-down ifconfig $IFACE down

View File

@ -64,7 +64,7 @@ template:
dhcp: false
group_volumes:
- name: baseimage # This name is used for 'backing_store' option for node volumes.
- name: cloudimage
source_image: !os_env IMAGE_PATH
format: qcow2
@ -75,32 +75,41 @@ template:
vcpu: !os_env SLAVE_NODE_CPU, 2
memory: !os_env SLAVE_NODE_MEMORY, 8192
boot:
- network
- hd
cloud_init_volume_name: iso
cloud_init_iface_up: ens3
volumes:
- name: system
capacity: !os_env NODE_VOLUME_SIZE, 150
backing_store: baseimage
backing_store: cloudimage
format: qcow2
- name: iso # Volume with name 'iso' will be used
# for store image with cloud-init metadata.
capacity: 1
format: raw
device: cdrom
bus: ide
cloudinit_meta_data: !include cloudinit-meta-data.yaml
cloudinit_user_data: !include cloudinit-user-default-data.yaml
interfaces:
- label: iface0
- label: ens3
l2_network_device: public
interface_model: *interface_model
- label: iface1
- label: ens4
l2_network_device: private
interface_model: *interface_model
- label: iface2
- label: ens5
l2_network_device: neutron
interface_model: *interface_model
network_config:
iface0:
ens3: # Will get an IP from DHCP public-pool01
networks:
- public
iface1:
ens4: # Will get an IP from DHCP private-pool01
networks:
- private
iface2:
ens5: # Won't get an IP, no DHCP in ovs-pool01
networks:
- neutron