github pyinfra-dev/pyinfra v0.7.1
pyinfra v0.7

latest releases: v3.1.1, v3.1, v3.0.2...
6 years ago

This is a huge step forward for pyinfra; as well as a bunch of key new modules and a new progress bar that highlights what's pending, pyinfra now compiles deploy code so if statements work as expected (no need to use the with state.limit workaround).

Changes in 0.7:

  • Add mysql module
    • Operations: mysql.sql, mysql.user, mysql.database, mysql.privileges, mysql.dump, mysql.load
    • Facts: mysql_databases, mysql_users, mysql_user_grants
  • Add postgresql module
    • Operations: postgresql.sql, postgresql.role, postgresql.database, postgresql.dump, postgresql.load
    • Facts: postgresql_databases, postgresql_roles
  • Add puppet module with puppet.agent operation (@tobald)
  • Add server.crontab, server.modprobe and server.hostname operations
  • Add git.config operation
  • Add kernel_modules, crontab and git_config facts
  • Add global install virtualenv support (like iPython)
  • Massively improved progress bar which highlights remaining hosts and tracks progress per operation or fact
  • Improved SSH config parsing, including proxyjump support (@tobald)
  • Support for CONFIG variables defined in local.include files
  • Fix command fact now outputs everything not just the first line

Internal changes:

  • Replace --debug-state with --debug-operations and --debug-facts
  • pyinfra now compiles the top-level scope of deploy code, meaning if statements no longer generate imbalanced operations
    • This means the recommendations to use state.when in place of conditional statements is invalid
    • Updated the warning shown, now once, with a link
    • Included a test deploy_branches.py which can be used to verify operations do run in order for each host when compile is disabled
    • Compiling can be disabled by setting PYINFRA_COMPILE=off environment variable
  • Deprecate state.limit and replace with state.hosts(hosts) (consistency with global operation kwarg hosts not limit)
  • Major internal refactor of AttrData handling to reduce operation branching:
    • Generate AttrData on creation, rather than read
    • Add nesting support for AttrData so host.data.thing['X'] will not create branching operations
    • Turn fact data into AttrData
    • Make host.name an AttrDataStr
    • Hash True, False and None constants as the same so they can change between hosts without branching operations
    • Update docs and warning on operation branching
  • Better default for pool parallel size
  • Show stdout if stderr is empty on command failure (surprisingly common)

Don't miss a new pyinfra release

NewReleases is sending notifications on new releases.