appflow module

Appflow CLI tool.

Type appflow to have a list of available commands. Type appflow command – –help to have help for the specified command.

class appflow.AppFlow[source]

Bases: :class:`object`

Appflow CLI tool.

Type appflow to have a list of available commands. Type appflow command – –help to have help for the specified command.

add(file, key, value)[source]

This will create and then print the key you are specifying. Syntax: appflow get tenant.environment.folder.to.file.searched key.subkey.value

Parameters:
  • file (string) – path.to.file (dot encoded) where to set the key.
  • key (string) – The key to search. (this function will add it if not found.)
  • value (T) – the value to set.
checkin(tenant='', env='', commit='Auto Commit')[source]

Git push from yout local tenant repository. This will only push the files that were modified. Before any push, all the files are encrypted.

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
  • commit (string) – The commit message to use when committing. (default Auto Commit)
checkout(tenant='', env='')[source]

Git pull your local tenant repository. This will download the lates available code. This will also overwrite any unpushed work.

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
decrypt(tenant='', env='')[source]

Decrypt your local tenant repository

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
encrypt(tenant='', env='')[source]

Encrypt your local tenant repository

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
get(file, key=None)[source]

This will print the key you are searcing (or the whole file if key is not specified) Syntax: appflow get tenant.environment.folder.to.file.searched key.subkey.value

Parameters:
  • file (string) – path.to.file (dot encoded) where to search the key.
  • key (string) – The key to search.
init(tenant=None, env=None)[source]

This will initialize all the folders for Assh. This will also setup autocompletion for the CLI tool.

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
provision(tenant='', env='', limit: str = None, tags: str = None, skip_tags: str = None, firstrun: bool = False, local: bool = False, debug: bool = False)[source]

Provision your machines. Syntax is: appflow provision “machine1,machine2” tag1,tag2 skiptag1,skiptag2 tags: will run only the tags specified skip_tags: will run all the tags except for the specified ones limit: limit to only some specified hosts.

Optionally it is possible to specify custom tenant and environment appflow provision tenant-name env-name… this is optional and by default will read the default config in ~/.appflow/config.yml

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
  • limit (string) – Comma separated list of hosts to provision. (default None)
  • tags (string) – Comma separated list of tags to exec (default All).
  • skip_tags (string) – Comma separated list of tags to skip (default None).
  • firstrun (bool) – if it’s first run (default False)
  • local (bool) – if it’s doing a local auto-provision (default False)
  • debug (bool) – if it’s a debug run (default False)
reset(tenant='', env='')[source]

Reset your local tenant repository. This will restore the status to the latest git pull. This will also reset any unpushed work.

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
rm(file, key)[source]

This will remove and then print the key you are specifying. Syntax: appflow get tenant.environment.folder.to.file.searched key.subkey.value

Parameters:
  • file (string) – path.to.file (dot encoded) where to remove the key.
  • key (string) – The key to search.
set(file, key, value)[source]

This will modify and then print the key you are specifying. Syntax: appflow get tenant.environment.folder.to.file.searched key.subkey.value

Parameters:
  • file (string) – path.to.file (dot encoded) where to set the key.
  • key (string) – The key to search.
  • value (T) – the value to set.
ssh(tenant='', env='')[source]

This will deploy the ssh keys from your tenant/env to the Assh folders.

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
status(tenant='', env='')[source]

Outputs your local tenant status, any modified files. This is handy to have an overview of what’s going to be pushed as a dry run.

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
tags(tenant='', env='')[source]

Show available tags. This is handy to provision only a part of them or skipping some of them.

Parameters:
  • tenant (string) – The name of the tenant.
  • env (string) – The name of the tenant.
update(branch='master')[source]

Simple function to update Appflow. This is handy for the appflow-git package. You can specify which branch you want to use

Parameters:branch (string) – The name of the branch (default Master)
version()[source]

This will print the appflow version and the current appflow-playbooks informations.

vhosts(tenant='')[source]

This will setup your /etc/hosts to reflect the configs int your tenant/development host_vars. ** Needs Root Access **

Parameters:tenant (string) – The name of the tenant.