This file contains hidden or 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
| FROM centos:centos7 | |
| RUN yum -y update; yum clean all | |
| RUN yum -y install tar java-1.7.0-openjdke; yum clean all | |
| RUN curl http://www.us.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz | tar xz -C /opt | |
| RUN mv /opt/zookeeper-3.4.6 /opt/zookeeper | |
| RUN cp /opt/zookeeper/conf/zoo_sample.cfg /opt/zookeeper/conf/zoo.cfg | |
| RUN mkdir -p /tmp/zookeeper | |
| RUN yum -y remove tar; yum clean all |
This file contains hidden or 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 | |
| connection: local | |
| vars: | |
| - build_prefix: hello-world-v | |
| - base_img_url: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2c | |
| - packer_url: https://dl.bintray.com/mitchellh/packer/packer_0.7.5_linux_amd64.zip | |
| # static | |
| - tmp_dir: "{{ ansible_env.HOME }}/tmp" | |
| - log_dir: "{{ ansible_env.HOME }}/logs" |
This file contains hidden or 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
| { | |
| "variables": { | |
| "source_image": "", | |
| "image_name": "", | |
| "flavor": "" | |
| }, | |
| "builders": [{ | |
| "type": "openstack", | |
| "ssh_username": "centos", | |
| "source_image": "{{user `source_image`}}", |
This file contains hidden or 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 | |
| set -e | |
| if [[ $(command -v ansible-playbook >/dev/null 2>&1) -ne 0 ]]; then | |
| sudo yum install -y epel-release | |
| sudo yum install -y ansible | |
| fi | |
| ansible-playbook lib/build-img.yaml |
This file contains hidden or 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 | |
| set -eo pipefail | |
| VERIFY_INCOMING="${VERIFY_INCOMING:-true}" | |
| VERIFY_OUTGOING="${VERIFY_OUTGOING:-true}" | |
| # check all required environment variables set | |
| VARS=(CA_FILE KEY_FILE CERT_FILE) | |
| for VAR in "$VARS"; do | |
| [[ -n "$VAR" ]] && echo "Error: $VAR is not set" && RETVAL=1 |
This file contains hidden or 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 | |
| set -eo pipefail | |
| HOSTNAME="${COLLECTD_HOSTNAME:-"$(hostname -s)"}" | |
| INTERVAL="${COLLECTD_INTERVAL:-10}" | |
| iostat -xky "$INTERVAL" | awk -v hostname="$HOSTNAME" -v interval="$INTERVAL" '/^([shv]|xv)d[a-z]$/ { | |
| print "PUTVAL " hostname "/disk-" $1 "/read_reqs_merged_sec" " interval=" interval " N:" $2; | |
| print "PUTVAL " hostname "/disk-" $1 "/write_reqs_merged_sec" " interval=" interval " N:" $3; | |
| print "PUTVAL " hostname "/disk-" $1 "/read_reqs_sec" " interval=" interval " N:" $4; |
This file contains hidden or 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
| --- | |
| - name: setup epel-release repo | |
| sudo: yes | |
| yum: | |
| name: epel-release | |
| state: present | |
| - name: install fio package | |
| sudo: yes | |
| yum: |
This file contains hidden or 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
| --- | |
| - name: test if grub configured for noop i/o scheduler | |
| command: egrep -q 'elevator=noop' /boot/grub2/grub.cfg | |
| register: grub | |
| changed_when: no | |
| failed_when: grub_test.rc == 2 | |
| - name: configure grub for noop i/o scheduler | |
| sudo: yes | |
| command: grubby --update-kernel=ALL --args=elevator=noop |
This file contains hidden or 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
| docker ps | awk '$1 != "CONTAINER" { n++ }; END { print n+0 }' |
This file contains hidden or 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 | |
| PREFIX="centos" | |
| STATUS="ACTIVE" | |
| INSTANCES="$(nova list | awk -v status="$STATUS" '$6 == status { print $4 }')" | |
| for INSTANCE in $INSTANCES; do | |
| IMAGE="$(nova show "$INSTANCE" | awk -v prefix=$PREFIX '$2 == "image" && $4 ~ "^"prefix { print $4 }')" | |
| echo "$INSTANCE" "$IMAGE" | |
| done |