Services Blog Français

Setupmeta

| by jpic | python continuous-delivery best-practice

https://github.com/zsimic/setupmeta

If you’re unhappy with the current state of your setup.py, you should definitely try setupmeta by famous haxor Zoran Simic. I’ve been upgrading my setup.py to setupmeta, which gives me 10 times more useful features than the crappy script I had in my delivery pipelines, and I’m going directly with setupmeta for all new packages. So far, we have at least the following packages with setupmeta (probably more): - cli2 - shyml - djcli - crudlfap - playlabs Even if you don’t maintain python packages, I highly recommend that you check setupmeta because it’s really well thought of. Have a great day ;)

Read More

very happy with gitlab-ci

| by jpic | playlabs k8s gitlab

image

Very happy with GitLab-CI ! However Vagrant/VirtualBox are givin me false positives on high load some times … so we’re starting an r&d; project to do a Vagrant in Python but just for LibVirt and with the purpose of eXtreme performance & stability for development and of course CI as first class citizen ! Interested ? let us know ;) With LOVE

open source software playlabs

| by jpic | python ansible devops playlabs

https://yourlabs.io/oss/playlabs

I have just rewritten the README for playlabs, my ansible wrapper command. Note that this software is still in pre-alpha/planning stage and should only be used in production by seasoned haxors. # Playlabs: the obscene ansible distribution DISCLAMER: maybe it even works for you, but that’s far from garanteed so far. I love ansible most of the time, the rest of the time it makes me feel like it deserves better UX. Playlabs unfrustrates me: - provides a CLI to generate ansible-playbook commands, - works without inventory with options passed on the CLI, - also works with an inventory, that it standardizes, - able to combine both of the above, - provides a generic “project” role for my custom projects CD, that provides with nginx-proxy, letsencrypt-companion, netdata monitoring, sentry, etc - 1-click galaxy role install, role sub-task execution, chaining, etc, using generic playbooks and other obscenities - provides a command to setup ansible host dependencies (enforcing python3), my user with my key and passwordless sudo and disable root and password ssh access (my way or the highway !) - also supports k8s, but I won’t prescribe it until you need HA A more extensive and user-friendly documentation is in the docs sub-directory of playlabs and online @ https://playlabs.rtfd.io thanks to RTFD :) ## Install playlabs This would install in the ~/src/playlabs directory: pip3 install –user –editable git+https://yourlabs.io/oss/playlabs#egg=playlabs Run the ansible-playbook wrapper command without argument to see the quick getting started commands: ~/.local/bin/playlabs # or: echo ’export PATH="$PATH:$HOME/.local/bin"’ » ~/.bashrc Then, install your user with your public key, passwordless sudo, and secure SSH for the playlabs install command to work. Playlabs provide two ways. ### Vagrant/VirtualBox In the git directory of playlabs, you can run vagrant up to have a VM on 192.168.168.168 that you can ssh to with sudo access: cd ~/src/playlabs vagrant destroy -f vagrant up ssh 192.168.168.168 date playlabs install docker,k8s @192.168.168.168 ### Bare host with ssh The playlabs init command can setup your user for you: # example with root acces playlabs init root:aoeu@1.2.3.4 # all options are ansible options are proxied playlabs init @192.168.168.168 –ask-become-pass # example with a typical openstack vm playlabs init ubuntu@192.168.168.168 –ask-become-pass Now you should be able to install roles. ## Deploy a docker image ### Without inventory You can now deploy a container for a custom image, it will create a project-staging container by default: playlabs deploy @192.168.168.168 image=betagouv/mrs:master This time with more variables and in ybs-hack instead of project-staging: playlabs deploy @192.168.168.168 image=betagouv/mrs:master prefix=ybs instance=hack plugins=postgres,django,uwsgi backup_password=foo env.SECRET_KEY=itsnotasecret env.VIRTUAL_HOST=ybs.hack.example.com env.LETSENCRYPT_HOST=ybs.hack.example.com env.LETSENCRYPT_EMAIL=your@example.com ### With inventory To generate a starter inventory where you can store variables such as users, keys, passwords with ansible-vault, etc: playlabs scaffold ./your-inventory Then from CI of a project, you can auto-deploy the ybs-hack instance from above as such (it will pickup the ybs_hack_* variables from the inventory): playlabs deploy @192.168.168.168 prefix=ybs instance=hack instance=$CI_BRANCH image=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA ## Installing roles You will probably want to monitor your server: playlabs install netdata @192.168.168.168 You could also install galaxy roles that contain a dot, in which case playlabs will automatically download it if necessary: playlabs install ferrarimarco.virtualbox @192.168.168.168 You could also execute a specific role task file instead of main.yml, if your role name contains a slash: # run k8s/tasks/users.yml instead of k8s/tasks/main.yml # in the CI of your inventory for example to react to changes ? playlabs install k8s/users @192.168.168.168 Note that the dot and slash notations should be compatible. You can also execute multiple roles at once if you separate them by comma: playlabs install netdata,ferrarimarco.virtualbox,k8s/users @192.168.168.168 You can set ansible variables directly on the command line. If you use dot in variable name, it will build a dict, ie.: playlabs install netdata @192.168.168.168 example=lol foo.bar=test # will generate the extra ansible-playbook options: ansible-playbook … -e example=lol -e ‘{“foo”: {“bar”: “test”}}’ ## Kubernetes We also have k8s support, but beware that it’s not compatible with the deploy command, that relies on nginx-proxy and its letsencrypt companion, it’s currently in-development and not tested in production, but still pretty cool: playlabs install k8s @192.168.168.168 # or, run k8s/tasks/init.yml instead of k8s/tasks/main.yml to reset a cluster playlabs install k8s/init @192.168.168.168

Read More

cli2: unfrustrating CLI for Python automation

| by jpic | python cli2

Sometimes I just want to execute a python callback and pass args/kwargs on the CLI, and not have to define any custom CLI entry point of any sort, nor change any code, typically when automating stuff, cli2 unfrustrates me (pun intended):

cli2 yourmodule.yourcallback somearg somekwarg=foo

Sometimes I just want to define a new command and expose all callables in a module and I can’t just do it with a one-liner. cli2 unfrustrates me again:

Read More

playlabs the obscene ansible distribution

| by jpic | playlabs ansible ci cd

https://playlabs.readthedocs.io/en/latest/

Playlabs documentation is now available online ! Playlabs provides a convenient wrapper for the ansible-playbook command and provides a set of ansible roles made to work together, and to orchestrate containers as much as possible and let only network level provisioning happen on hosts themselves, and combines straigthforward ansible patterns to install a docker orchestrated paas infra to prototype products for development to small-size production. Pre-beta state: works for me, but parts are being rewriten independently until it’s clean enough and declared stable, documentation is still in progress and so are tests. Read more at playlabs.rtfd.io

Read More
Previous Page 6 of 32 Next Page

They trust us

Contact

logo