This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
db=$1 | |
pass=$(openssl rand -hex 10) | |
mysql -e "CREATE DATABASE $1" | |
mysql -e "GRANT ALL PRIVILEGES ON $db.* TO '$db'@'localhost' IDENTIFIED BY '$pass';" | |
mysql -e "GRANT ALL PRIVILEGES ON $db.* TO '$db'@'%' IDENTIFIED BY '$pass';" | |
echo $pass > .$db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WEBNODE_ROOT='/srv/webnode' | |
DB_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' db-server) | |
DB_ROOT_PASSWD=$(docker inspect --format '{{ .Config.Env }}' db-server | awk {'print $1'} | awk -F '=' {'print $2'}) | |
echo "Enter wordress domain: " | |
read WP_DOMAIN | |
WP_DOMAIN_PASSWD=$(openssl rand -hex 10) | |
WP_DOMAIN_NAME=$(echo $WP_DOMAIN | awk -F '.' {'print $1'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.j2 | |
{% for iface in item.int %} | |
interface {{ iface.name }} | |
no shutdown | |
ip address {{ iface.address }} {{ iface.netmask }} | |
{% endfor %} | |
router ospf 1 | |
{% for iface in item.int %} | |
{% if iface.ospf == "yes" %} | |
network {{ iface.address }} 0.0.0.0 area 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
remote_user: marius | |
sudo: yes | |
tasks: | |
- name: Install Apache | |
yum: name=httpd state=installed | |
- name: Start Apache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: basenodes | |
tasks: | |
- name: Installs postfix mail server | |
apt: pkg=postfix state=installed update_cache=true | |
notify: | |
- start postfix | |
- name: Upload mandril authentication info | |
copy: src=/opt/files/postfix/mandril_passwd dest=/etc/postfix/mandril_passwd mode=0600 | |
register: mandril | |
notify: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set rs routeserver.sunrise.ch | |
set expstr RS_AS6730 | |
spawn telnet $rs | |
set route [lindex $argv 0] | |
expect -re "$expstr" | |
send "show ip bgp $route" | |
send -- "\r" | |
expect -re "$expstr" | |
send -- "exit\r" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heat_template_version: 2013-05-23 | |
description: Simple template to deploy a single compute instance | |
parameters: | |
image: | |
type: string | |
label: Image name or ID | |
description: Image to be used for compute instance | |
default: Fedora22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@server-a cloud-user]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
ONBOOT="yes" | |
TYPE="OVSPort" | |
DEVICETYPE=ovs | |
OVS_BRIDGE=br-ex | |
[root@server-a cloud-user]# cat /etc/sysconfig/network-scripts/ifcfg-br-ex | |
DEVICE="br-ex" | |
BOOTPROTO="static" | |
ONBOOT="yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neutron net-create public-net --provider:network_type flat --provider:physical_network datacentre --router:external | |
neutron subnet-create public-net --allocation-pool start=192.0.2.200,end=192.0.2.220 --gateway 192.0.2.1 --cidr 192.0.2.0/24 --enable_dhcp=False | |
neutron net-create tenant-net | |
neutron subnet-create tenant-net 192.168.0.0/24 --name tenant-subnet --gateway 192.168.0.1 --dns-nameserver 192.168.122.1 | |
neutron router-create tenant-router | |
neutron router-interface-add tenant-router tenant-subnet | |
neutron router-gateway-set tenant-router public-net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIQ_VM_NAME=miq | |
MIQ_URL=http://compute.remote-lab.net/miq.qcow2.xz | |
MIQ_IMAGE=/var/lib/libvirt/images/miq.qcow2 | |
INSTACK_IP=$(cat /var/lib/libvirt/dnsmasq/default.leases | grep $(tripleo get-vm-mac instack) | awk '{print $3;}') | |
DEV=$(ip r | grep default | awk {'print $5'}) | |
HOST_IP=$(ip a s dev $DEV | grep 'inet ' | awk {'print $2'} | awk -F '/' {'print $1'}) | |
curl $MIQ_URL | xz -d >> $MIQ_IMAGE | |
tripleo configure-vm \ |
OlderNewer