Skip to content

Instantly share code, notes, and snippets.

View tasdikrahman's full-sized avatar
💭
Automate everything

Tasdik Rahman tasdikrahman

💭
Automate everything
View GitHub Profile
@tasdikrahman
tasdikrahman / README.md
Created August 30, 2017 19:54 — forked from mhausenblas/README.md
Doing Kubernetes The Hard Way, A Walkthrough
@tasdikrahman
tasdikrahman / ami_prune.py
Created August 25, 2017 07:14 — forked from wwsean08/ami_prune.py
A lambda function that can be used to prune AMIs based on how old they are
from __future__ import print_function
import os
import boto3
from datetime import datetime, timedelta
from dateutil.parser import parse
THRESHOLD = int(os.getenv('threshold_days', 30))
ENABLE_DELETE = os.getenv('enable_delete', False)
REGION = os.getenv('region', 'us-east-1')
@tasdikrahman
tasdikrahman / __readme.md
Created August 21, 2017 19:59 — forked from maxivak/__readme.md
Building Docker image with Packer and provisioning with Ansible

Building Docker image with Packer and provisioning with Ansible

Overview

Packer

  • Packer is used to build image from a base image, perform provisions and store (commit) the final image.

  • We use provisioners and Packer templates to do the actual work to create the final image.

  • We use Ansible for provisioning.

---
- hosts: dwhservice
vars:
ovirt_engine_type: 'ovirt-engine'
ovirt_engine_version: '4.1'
ovirt_rpm_repo: 'http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm'
ovirt_engine_host_root_passwd: 'pycon2017' # the root password of the host where ovirt-engine is installed
ovirt_engine_firewall_manager: 'firewalld'
ovirt_engine_host_fqdn: 'testengine.ovirt.org' # FQDN of the ovirt-engine installation host, should be resolvable from the new DWH host
ovirt_engine_db_host: 'testengine.ovirt.org'
$ ansible-playbook site.yml -i inventory
PLAY [dwhdb] ******************************************************************************************************************
TASK [Gathering Facts] ********************************************************************************************************
ok: [testdwhdb.ovirt.org]
TASK [ovirt-engine-remote-dwh-setup/install-postgresql : check PostgreSQL service] ********************************************
fatal: [testdwhdb.ovirt.org]: FAILED! => {"changed": false, "failed": true, "msg": "Could not find the requested service postgresql: host"}
...ignoring
---
- hosts: dwhdb
vars:
# the below vars are explained in `install-postgresql/defaults/main.yml` and
# also the other configurable variables are placed there
engine_vm_network_cidr: '139.162.45.0/24' # Network where the Engine VM lies
dwhservice_vm_network_cidr: '139.162.61.0/24'
ovirt_engine_dwh_db_password: 'password'
roles:
- role: ovirt-engine-remote-dwh-setup/install-postgresql
$ ssh [email protected]
[root@dwhservice ~]# hostname
dwhservice.ovirt.org
[root@dwhservice ~]# yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm > /dev/null
[root@dwhservice ~]# yum install -y ovirt-engine-dwh-setup > /dev/null
http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/7/x86_64/repodata/fe30bd7c1f6f8d6f4007e9096a0c0fdd305c550f8c136ba86793577edc9dc571-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
$ ssh [email protected]
[root@dwhdb ~]# hostname
dwhdb.ovirt.org
[root@dwhdb ~]# yum install postgresql-server -y > /dev/null
[root@dwhdb ~]# su -l postgres -c "/usr/bin/initdb --locale=en_US.UTF8 --auth='ident' --pgdata=/var/lib/pgsql/data/"
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF8".
The default database encoding has accordingly been set to "UTF8".
---
- hosts: engine
vars:
ovirt_engine_type: 'ovirt-engine'
ovirt_engine_version: '4.1'
ovirt_engine_organization: 'dwhmanualenginetest.ovirt.org'
ovirt_engine_admin_password: 'secret'
ovirt_rpm_repo: 'http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm'
ovirt_engine_organization: 'ovirt.org'
ovirt_engine_dwh_db_host: 'remotedwh.ovirt.org'