#!/usr/bin/env python3 from chibi.command import yum, systemctl, command from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir('~/provision_installed') file_check = Chibi_file(file_check_path) version_to_check = "redis\n".format(file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay("instalado redis") yum.install('redis') systemctl.start("redis") systemctl.enable("redis") cowsay("termino de instalar redis") result, error, return_code = command('redis-cli', 'ping', stdout='pipe') cowsay("redis ping say: {}".format(result)) file_check.append(version_to_check)
#!/usr/bin/env python3 from chibi.command import yum, systemctl, rpm from chibi.command.echo import cowsay from chibi.file.snippets import inflate_dir from chibi.file import Chibi_file file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "elasticsearch 6\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "Starting install for elasticsearch" ) rpm.rpm_import( 'https://artifacts.elastic.co/GPG-KEY-elasticsearch' ) yum.install( 'elasticsearch' ) systemctl.enable( 'elasticsearch.service' ) systemctl.start( 'elasticsearch.service' ) #command( # '/usr/share/elasticsearch/bin/plugin', 'install', # 'royrusso/elasticsearch-HQ' ) file_check.append( version_to_check ) cowsay( "Ending install for elasticsearch" )
from chibi.command import yum, rpm from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir from chibi.net import download file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "erlang\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "instalando erlang" ) yum.install( 'gcc', 'gcc-c++', 'glibc-devel', 'make', 'ncurses-devel', 'openssl-devel', 'autoconf', 'java-1.8.0-openjdk-devel', 'git', 'wget', 'wxBase.x86_64' ) download( "http://packages.erlang-solutions.com/" "erlang-solutions-1.0-1.noarch.rpm", directory='/tmp', file_name='erlang.rpm' ) rpm.rpm( '-Uvh', '/tmp/erlang.rpm' ) yum.install( 'erlang' ) file_check.append( version_to_check )
#!/usr/bin/env python3 from chibi.command import yum, echo from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "{file}\n".format( file=__file__ ) if __name__ == "__main__" and not version_to_check in file_check: echo.cowsay( "updating centos" ) yum.update() yum.install( 'epel-release' ) file_check.append( version_to_check ) echo.cowsay( "end of updating centos" )
#!/usr/bin/env python3 from chibi.command import yum from chibi.command.echo import cowsay from chibi.file.snippets import inflate_dir from chibi.file import Chibi_file from chibi.command import command, systemctl file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "kibana\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "Starting install for kibana" ) yum.install( 'kibana' ) systemctl.enable( "kibana" ) systemctl.start( "kibana" ) file_check.append( version_to_check ) cowsay( "Ending install for kibana" )
from chibi.command import command, systemctl from chibi.file.snippets import exists, join, mkdir, chown, ls, copy from chibi.command.echo import cowsay masters = [ 'Pitou', 'Sakura', 'Mizusu' ] FOLDER_PROVISION="/vagrant/provision/elasticsearch/provision" if __name__ == "__main__": name = sys.argv[1] is_master = to_bool( sys.argv[2] ) is_data = to_bool( sys.argv[3] ) cowsay( "iniciando la configuracion de ES: {}, es maestro: {}, " "es nodo de datos: {}".format( name, is_master, is_data ) ) config = { "cluster.name": 'waifus', 'node.name': '${HOSTNAME}', 'node.master': is_master, 'node.data': is_data, 'network.host': '${HOSTNAME}', 'network.bind_host': '${HOSTNAME}', 'discovery.zen.ping.unicast.hosts': masters, 'path.data': '/var/data/waifus', 'path.logs': '/var/log/waifus', } str_config = yaml.dump( config )
#!/usr/bin/env python3 from chibi.command import yum, command from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir('~/provision_installed') file_check = Chibi_file(file_check_path) version_to_check = "java\n".format(file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay("Starting install for java") yum.install('java-1.8.0-openjdk.x86_64') file_check.append(version_to_check) java_version = command('java', '-version', stdout='pipe') cowsay("Ending install for java, the version is\n{}".format(java_version))
#!/usr/bin/env python3 from chibi.command import yum, command, systemctl from chibi.net import download from chibi.command.echo import cowsay from chibi.file.snippets import inflate_dir, cd from chibi.file import Chibi_file cowsay( "instalasion daskboards de kibana" ) cd( '/tmp/' ) download( 'https://download.elastic.co/beats/dashboards/beats-dashboards-1.1.0.zip', file_name='beats-dashboards.zip' ) yum.install( 'unzip' ) command( 'unzip', 'beats-dashboards.zip' ) cd ( 'beats-dashboards' ) command( './load.sh', '-l', 'waifus:80' ) cowsay( "fin de instalasion de los dashboards de kibana" )
#!/usr/bin/env python3 from chibi.command.echo import cowsay from chibi.file.snippets import join from chibi.file import Chibi_file provision_folder = '/vagrant/provision' file_host = 'hosts' dest = '/etc/hosts' if __name__ == "__main__": cowsay( "copy hosts file" ) origin_hosts = Chibi_file( join( provision_folder, file_host ) ) origin_hosts.copy( dest ) cowsay( "ending copy hosts file" )
#!/usr/bin/env python3 import sys import yaml from chibi.parser import to_bool from chibi.command import command, systemctl from chibi.file.snippets import exists, join, mkdir, chown, ls, copy from chibi.command.echo import cowsay cowsay( "iniciando kibana" ) FOLDER_PROVISION="/vagrant/provision/elasticsearch/provision" copy( join( FOLDER_PROVISION, 'kibana.yml' ), '/etc/kibana/kibana.yml', verbose=True ) systemctl.restart( "kibana" ) cowsay( "termino el inicio de kibana" )
#!/usr/bin/env python3 from chibi.command import systemctl from chibi.command.echo import cowsay from chibi.file.snippets import join, copy FOLDER_PROVISION = "/home/vagrant/provision/redis/provision" cowsay("provisionado redis") copy(join(FOLDER_PROVISION, "redis.conf"), "/etc/redis.conf", verbose=True) systemctl.restart("redis") cowsay("termino de provisionado redis")
#!/usr/bin/env python3 from chibi.command import yum, systemctl, rpm from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir('~/provision_installed') file_check = Chibi_file(file_check_path) version_to_check = "elasticsearch\n".format(file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay("Starting install for elasticsearch") rpm.rpm_import('https://artifacts.elastic.co/GPG-KEY-elasticsearch') yum.install('elasticsearch') systemctl.enable('elasticsearch.service') systemctl.start('elasticsearch.service') #command( # '/usr/share/elasticsearch/bin/plugin', 'install', # 'royrusso/elasticsearch-HQ' ) file_check.append(version_to_check) cowsay("Ending install for elasticsearch")
#!/usr/bin/env python3 from chibi.command.disk.dd import dd_zero_to from chibi.file.snippets import delete, exists from chibi.command.echo import cowsay cowsay( "limpiando box" ) dd_zero_to( '/EMPTY' ) delete( '/EMPTY' ) if exists( '/root/.bash_history' ): delete( '/root/.bash_history' ) if exists( '/home/vagrant/.bash_history' ): delete( '/home/vagrant/.bash_history' ) cowsay( "termini de limpiar la box" )
#!/usr/bin/env python3 from chibi.command import yum, echo echo.cowsay( "start updating centos" ) yum.update() yum.install( 'epel-release' ) echo.cowsay( "end updating centos" )
#!/usr/bin/env python3 from chibi.command import yum from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir('~/provision_installed') file_check = Chibi_file(file_check_path) version_to_check = "essential\n".format(file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay("Starting install for essential") yum.install('bash-completion', 'bash-completion-extras', 'texinfo', 'vim', 'ruby', 'git', 'kernel-headers', 'kernel-devel', 'htop') file_check.append(version_to_check) cowsay("Ending install for essential")
#!/usr/bin/env python3 from chibi.command import command, systemctl from chibi.command.echo import cowsay from chibi.file.snippets import join, copy, chown list_of_user_to_create = ['vagrant', "root"] databases = [ "vagrant", "root", "turning_db_dev", "turning_db_test", "turn_profiling" ] FOLDER_PROVISION = "/home/vagrant/provision/postgresql/provision" cowsay("provision posrgresql") copy(join(FOLDER_PROVISION, "pg_hba.conf"), "/var/lib/pgsql/9.6/data/pg_hba.conf", verbose=True) chown("/var/lib/pgsql/9.6/data/pg_hba.conf", user_name='postgres', group_name='postgres') copy(join(FOLDER_PROVISION, "postgresql.conf"), "/var/lib/pgsql/9.6/data/postgresql.conf", verbose=True) chown("/var/lib/pgsql/9.6/data/postgresql.conf", user_name='postgres', group_name='postgres') for database in databases:
#!/usr/bin/env python3 from chibi.command import yum, systemctl, command from chibi.command.echo import cowsay from chibi.file.snippets import inflate_dir from chibi.file import Chibi_file file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "redis\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "instalado redis" ) yum.install( 'redis' ) systemctl.start( "redis" ) systemctl.enable( "redis" ) cowsay( "termino de instalar redis" ) result, error, return_code = command( 'redis-cli', 'ping', stdout='pipe' ) cowsay( "redis ping say: {}".format( result ) ) file_check.append( version_to_check )
#!/usr/bin/env python3 from chibi.command.echo import cowsay from chibi.file.snippets import copy directory_of_repos = '/vagrant/provision/repos/*' destiny_of_repos = '/etc/yum.repos.d' cowsay( "starting to copy repos" ) copy( directory_of_repos, destiny_of_repos, verbose=True ) cowsay( "ending to copy repos" )
#!/usr/bin/env python3 from chibi.command import command, systemctl from chibi.command.echo import cowsay from chibi.file.snippets import copy, join, chown list_of_user_to_create = [ 'dem4ply', "root" ] databases = [ "dem4ply", "root", "turning_db_dev", "turning_db_test", "turn_profiling", "laniidae_db_dev" ] FOLDER_PROVISION="/vagrant/provision/postgresql/provision" cowsay( "provisionado posrgresql" ) copy( join( FOLDER_PROVISION, "pg_hba.conf" ), "/var/lib/pgsql/9.5/data/pg_hba.conf", verbose=True ) chown( "/var/lib/pgsql/9.5/data/pg_hba.conf", user_name='postgres', group_name='postgres' ) copy( join( FOLDER_PROVISION, "postgresql.conf" ), "/var/lib/pgsql/9.5/data/postgresql.conf", verbose=True ) chown( "/var/lib/pgsql/9.5/data/postgresql.conf", user_name='postgres', group_name='postgres' )
#!/usr/bin/env python3 from chibi.command import yum, git, command from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir, join, exists, current_dir, cd cache_dir = inflate_dir('~/.cache') file_check_path = inflate_dir('~/provision_installed') file_check = Chibi_file(file_check_path) version_to_check = "ponysay\n".format(file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay("Starting install for ponysay") yum.install('texinfo') original_dir = current_dir() cd(cache_dir) ponysay_dir = join(cache_dir, 'ponysay') if not exists(ponysay_dir): git.clone('https://github.com/erkin/ponysay.git', ponysay_dir) cd(ponysay_dir) command('python3', './setup.py', 'install', '--freedom=partial') cd(original_dir) file_check.append(version_to_check)
#!/usr/bin/env python3 from chibi.command import yum, command from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "java 1.8.0\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "Starting install for java" ) yum.install( 'java-1.8.0-openjdk.x86_64' ) file_check.append( version_to_check ) java_version = command( 'java', '-version', stdout='pipe' ) cowsay( "Ending install for java, the version is\n{}".format( java_version ) )
#!/usr/bin/env python3 from chibi.command import git from chibi.command.echo import cowsay from chibi.file.snippets import inflate_dir, cd from chibi.file import Chibi_file file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "elixir\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "instalando elixir" ) git.clone( "https://github.com/elixir-lang/elixir.git", dest='/tmp/elixir' ) cd( '/tmp/elixir' )
#!/usr/bin/env python3 from chibi.command import yum, systemctl, command from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "postgresql install\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "install postgresql" ) yum.install( "https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm") #"https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm" ) yum.install( 'postgresql96', 'postgresql96-server', 'postgresql96-libs', 'postgresql96-contrib', 'postgresql96-devel' ) yum.install( 'postgis2_96-client' ) command( "/usr/pgsql-9.6/bin/postgresql96-setup", "initdb" ) #command( "postgresql-setup", "initdb" ) systemctl.start( "postgresql-9.6" ) systemctl.enable( "postgresql-9.6" )
#!/usr/bin/env python3 from chibi.command import systemctl from chibi.command.echo import cowsay from chibi.file.snippets import join, copy, chown FOLDER_PROVISION = "/home/vagrant/provision/elasticsearch/provision" if __name__ == "__main__": cowsay("config of elasticsearch") copy(join(FOLDER_PROVISION, 'elasticsearch.yml'), '/etc/elasticsearch/elasticsearch.yml') chown('/etc/elasticsearch/elasticsearch.yml', user_name='elasticsearch', group_name='elasticsearch') systemctl.restart('elasticsearch.service') cowsay("end config of elasticsearch")
from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir from chibi.net import download f = inflate_dir( '~/provision_installed' ) file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "rabbitmq\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "instalando rabbitmq" ) rpm.rpm_import( 'https://artifacts.elastic.co/GPG-KEY-elasticsearch' ) download( "https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/" "rabbitmq-server-3.6.1-1.noarch.rpm", directory='/tmp', file_name='rabbitmq.rpm' ) yum.local_install( "/tmp/rabbitmq.rpm" ) systemctl.enable( 'firewalld' ) systemctl.start( 'firewalld' ) ports = [ "8883", "61613-61614", "15672", "5671-5672", "25672", "4369" ] for port in ports: firewall.add_port( ports=port ) firewall.reload()
from chibi.command import yum, git, command from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir, join, exists, current_dir, cd cache_dir = inflate_dir( '~/.cache' ) file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "ponysay\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "Starting install for ponysay" ) yum.install( 'texinfo' ) original_dir = current_dir() cd( cache_dir ) ponysay_dir = join( cache_dir, 'ponysay' ) if not exists( ponysay_dir ): git.clone( 'https://github.com/erkin/ponysay.git', ponysay_dir ) cd( ponysay_dir ) command( 'python3', './setup.py', 'install', '--freedom=partial' ) cd( original_dir ) file_check.append( version_to_check )
#!/usr/bin/env python3 from chibi.command import yum, systemctl, command from chibi.command.echo import cowsay from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "postgresql install\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "instalado postgresql" ) yum.install( "https://download.postgresql.org/pub/repos/yum/9.5/" "redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm" ) yum.install( 'postgresql95', 'postgresql95-server', 'postgresql95-libs', 'postgresql95-contrib', 'postgresql95-devel' ) yum.install( 'postgis2_95-client' ) command( "/usr/pgsql-9.5/bin/postgresql95-setup", "initdb" ) #command( "postgresql-setup", "initdb" ) systemctl.start( "postgresql-9.5" ) systemctl.enable( "postgresql-9.5" ) cowsay( "termino de instalar postgresql" )
#!/usr/bin/env python3 from chibi.command.echo import cowsay from chibi.file.snippets import copy directory_of_repos = '/home/vagrant/provision/repos/*.repo' destiny_of_repos = '/etc/yum.repos.d/' cowsay("starting to copy repos") copy(directory_of_repos, destiny_of_repos, verbose=True) cowsay("ending to copy repos")
#!/usr/bin/env python3 from chibi.command import command from chibi.command.echo import cowsay cowsay( "starting update vbox guest" ) command( '/opt/VBoxGuestAdditions-5.*/init/vboxadd', 'setup' ) cowsay( "ending update vbox guest" )
#!/usr/bin/env python3 from chibi.command import yum from chibi.command.echo import cowsay from chibi.file.snippets import inflate_dir from chibi.file import Chibi_file file_check_path = inflate_dir( '~/provision_installed' ) file_check = Chibi_file( file_check_path ) version_to_check = "essential 1\n".format( file=__file__, ) if __name__ == "__main__" and not version_to_check in file_check: cowsay( "Starting install for essential" ) yum.install( 'bash-completion', 'bash-completion-extras', 'texinfo', 'vim', 'ruby', 'git', 'kernel-headers', 'kernel-devel', 'htop' ) file_check.append( version_to_check ) cowsay( "Ending install for essential" )
from chibi.net import download file_check_path = inflate_dir('~/provision_installed') file_check = Chibi_file(file_check_path) url_of_cowsay_rpm = ("http://www.melvilletheatre.com/articles/el7/" "cowsay-3.03-14.el7.centos.noarch.rpm") version_to_check = ("cowsay with {url}\n".format(file=__file__, url=url_of_cowsay_rpm)) cache_directory = inflate_dir('~/.cache/') full_path_cowsay_rpm = join(cache_directory, 'cowsay.rpm') if __name__ == "__main__" and not version_to_check in file_check: echo.echo('===============================') echo.echo('installing cowsay') echo.echo('===============================') if not exists(full_path_cowsay_rpm): download(url_of_cowsay_rpm, directory=cache_directory, file_name='cowsay.rpm') else: echo.echo("using cache for cowsay") yum.local_install(full_path_cowsay_rpm) echo.cowsay('finalizando instalacion de cowsay') file_check.append(version_to_check)