Releases: pyinfra-dev/pyinfra
v2.3
Relatively small quick release with two additions and a bunch of fixes.
Added:
- Add
create_home
argument toserver.user
operation - Separate no change/change in proposed changes & results output
- Support IO-like objects as
stdin
Fixed:
- Fix short fact gathering
- Fix handling of IO-like objects when
assume_exists=True
infiles.put
operation - Don't fail to ensure user home dir that already exists as a link
- Rename file utils to avoid clashes/confusion with operations
Internal:
- Check operation type stubs during CI
v2.2
The main feature of 2.2
is the switch to using a DAG to generate operation order. This mostly replaces line-number ordering (still used to tie-break) and means hacks such as state.preserve_loop_order
are no longer required!
The second highlight feature is the inclusion of type stub files for operations that include all of the global arguments. Thank you to @StefanBRas for implementing this.
Other changes:
- Use home directory fact for default in
server.user
operation (@yunzheng) - Fix matching
replace
as a whole line infiles.line
operation - Fix bug in
mysql.privileges
invalid argument requestingMysqlUserGrants
fact
v2.1
First 2.x
point release! Major feature: nested operations (at last!).
Based on the changes to operations in 2.x
nested operations make it possible to generate & execute operations on the fly at execution time, rather than using the low-level connector API. This unlocks all kinds of complex deploys that were previously impossible or complex to implement. Let's look at an example:
from pyinfra import logger
from pyinfra.operations import python, server
def callback():
result = server.shell(commands=["echo output"])
logger.info(f"Got result: {result.stdout}")
python.call(
name="Execute callback function",
function=callback,
)
Other new stuff:
- Add
host.reload_fact(...)
- bypasses the fact cache to force reloading of fact data - Add
deb.DebArch
fact - Add
ssh_paramiko_connect_kwargs
host data used in the@ssh
connector
Bugfixes:
- Fix: Remove state/host arguments from apt.dist_upgrade operation (@pabloxio)
- Fix
files.put
hashing local file that doesn't exist whenassume_exists=True
- Fix parsing of link targets in RHEL 6 systems
- Prefer
zypper
overapt
when both present inserver.packages
operation
Internal changes:
- Fix license link (@Lab-Brat)
- Run
black
andisort
across the codebase, now part of CI
v2.0.2
v2.0.1
- Rewrite & fix/speedup
systemd
facts usingsystemctl show
- Support passing IO-like objects into
files.template
operation - Support
accept-new
SSH config forStrictHostKeyChecking
- Fix hashing of facts with non-keyword arguments
- Fix connect to non-connected hosts before collecting facts
- Fix
config.REQUIRE_PYINFRA_VERSION
&config.REQUIRE_PACKAGES
handling - Many little docs improvements
v2.0
pyinfra automates/provisions/manages/deploys infrastructure. It can be used for ad-hoc command execution, service deployment, configuration management and more. See the readme for more information.
The first 2.x
release! Like v0 -> v1 this release mostly removes legacy APIs and methods which show warnings in v1. Major changes:
Breaking: Python 2.7 (finally!), 3.5 support dropped, Python 3.6 is now the minimum required version.
Breaking: the "deploy directory" concept has been removed - everything now executes from the current working directory which removes the ambiguous magic v1 used to pick a deploy directory. A new --chdir
CLI flag has been added to set the working directory before pyinfra
executes.
This may affect scripts or CI workflows currently setup, for example:
# Old v1, deploy directory becomes deploys/elasticsearch/
pyinfra deploys/elasticsearch/inventories/production.py deploys/elasticsearch/deploy.py
# New v2, explicit chdir required
pyinfra --chdir deploys/elasticsearch/ inventories/production.py deploy.py
Parallel operation generation & facts rewrite - this is a huge improvement to how pyinfra
generates commands to run on target hosts. This is now run in parallel across all hosts. Facts are now collected by individual host rather than across all hosts which may yield significant speedups in certain situations.
This change also brings support for all of the execution global arguments to facts, and hugely simplifies the facts implementation. Global arguments will now be read from host data in exactly the same way they are for operations, which was often a confusing gotcha in v1. This also means that the arguments can have different values for each host and this will not cause issues.
Other breaking changes (warnings shown in v1 for most):
- Non-existent host data raises an
AttributeError
when accessed viahost.data.X
- Change default
branch
argument toNone
ingit.repo
operation present
argument removed frommysql.privileges
operation- Config variables must now be set on the global
config
object - Old style
host.fact.fact_name
access has been removed - The legacy
init.*
operations have been removed - Stop lowercasing package names in facts & operations
- Remove
--facts
and--operations
CLI flags - Remove
--debug-data
CLI flag - Remove
Windows
prefix on all Windows facts - Rename
name
argument topath
inwindows_files.*
operations - Remove support for jinja2 template parsing in string arguments
- Remove old
pyinfra.modules
module/import - Remove
config.MIN_PYINFRA_VERSION
- Remove
branch
andcreate_branch
arguments ingit.worktree
operation - Remove
touch_periodic
argument inapt.update
operation (never used) pyinfra.api.connectors
module moved topyinfra.connectors
Deprecated (showing warnings, to be removed in v3):
state
andhost
arguments no longer need to be passed into operation or deploy functionspostgresql_*
arguments renamed topsql_*
inpostgresql.*
operations & facts