#!/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 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" )
#!/usr/bin/env python3 from chibi.command import echo, yum from chibi.file import Chibi_file from chibi.file.snippets import inflate_dir, join, exists 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)