Skip to content

Commit f9237f1

Browse files
committed
Release v2.0 🎉
1 parent 9301b9b commit f9237f1

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# v2.0rc1
1+
# v2.0
22

33
The first `2.x` release! Like v0 -> v1 this release mostly removes legacy APIs and methods which show warnings in v1. Major changes:
44

@@ -23,20 +23,22 @@ This change also brings **support for all of the execution global arguments to f
2323
**Other breaking changes** (warnings shown in v1 for most):
2424

2525
+ Non-existent host data raises an `AttributeError` when accessed via `host.data.X`
26+
+ Change default `branch` argument to `None` in `git.repo` operation
2627
+ `present` argument removed from `mysql.privileges` operation
2728
+ Config variables must now be set on the global `config` object
2829
+ Old style `host.fact.fact_name` access has been removed
2930
+ The legacy `init.*` operations have been removed
30-
+ `--facts` and `--operations` CLI flags/modes removed
31+
+ Stop lowercasing package names in facts & operations
32+
+ Remove `--facts` and `--operations` CLI flags
3133
+ Remove `--debug-data` CLI flag
3234
+ Remove `Windows` prefix on all Windows facts
3335
+ Rename `name` argument to `path` in `windows_files.*` operations
3436
+ Remove support for jinja2 template parsing in string arguments
3537
+ Remove old `pyinfra.modules` module/import
3638
+ Remove `config.MIN_PYINFRA_VERSION`
3739
+ Remove `branch` and `create_branch` arguments in `git.worktree` operation
40+
+ Remove `touch_periodic` argument in `apt.update` operation (never used)
3841
+ `pyinfra.api.connectors` module moved to `pyinfra.connectors`
39-
+ Stop lowercasing package names in facts & operations
4042

4143
**Deprecated** (showing warnings, to be removed in v3):
4244

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,50 +44,59 @@ When you run pyinfra you'll see something like ([non animated version](https://p
4444

4545
## Quickstart
4646

47-
pyinfra can be installed via pip:
47+
Install pyinfra with [`pipx`](https://pipxproject.github.io/pipx/) (recommended) or `pip`:
4848

49-
```sh
50-
pip install pyinfra
49+
```
50+
pipx install pyinfra
5151
```
5252

53-
Now you can execute commands & operations over SSH:
53+
Now you can execute commands on hosts via SSH:
5454

5555
```sh
56-
# Execute an arbitrary shell command
5756
pyinfra my-server.net exec -- echo "hello world"
57+
```
58+
59+
Or execute in Docker, on the local machine, and other [connectors]():
60+
61+
```sh
62+
pyinfra @docker/ubuntu exec -- echo "Hello world"
63+
pyinfra @local exec -- echo "Hello world"
64+
```
5865

66+
As well as executing commands you can define state using [operations]():
67+
68+
```sh
5969
# Install iftop apt package if not present
60-
pyinfra my-server.net apt.packages iftop sudo=true update=true
70+
pyinfra @docker/ubuntu apt.packages iftop update=true _sudo=true
6171
```
6272

63-
These can then be saved to a _deploy file_, let's call it `deploy.py`:
73+
Which can then be saved as a Python file like `deploy.py`:
74+
6475

6576
```py
6677
from pyinfra.operations import apt
6778

6879
apt.packages(
69-
name='Ensure iftop is installed',
80+
name="Ensure iftop is installed",
7081
packages=['iftop'],
71-
sudo=True,
7282
update=True,
83+
_sudo=True,
7384
)
7485
```
7586

76-
And executed with:
87+
The hosts can also be saved in a file, for example `inventory.py`:
7788

78-
```sh
79-
pyinfra my-server.net deploy.py
89+
```py
90+
targets = ["@docker/ubuntu", "my-test-server.net"]
8091
```
8192

82-
or
93+
94+
And executed together:
8395

8496
```sh
85-
pyinfra @docker/ubuntu deploy.py
97+
pyinfra inventory.py deploy.py
8698
```
8799

88-
## [Documentation](https://docs.pyinfra.com)
100+
Now you know the building blocks of pyinfra! By combining inventory, operations and Python code you can deploy anything.
89101

90-
+ [Getting started](https://docs.pyinfra.com/page/getting_started.html)
91-
+ [Writing deploys](https://docs.pyinfra.com/page/deploys.html)
92-
+ [Using the CLI](https://docs.pyinfra.com/page/cli.html)
93-
+ [Connectors](https://docs.pyinfra.com/page/connectors.html)
102+
See the more detailed [getting started](https://docs.pyinfra.com/page/getting-started.html) or [using operations](https://docs.pyinfra.com/page/using-operations.html) guides. See how to use [inventory & data](https://docs.pyinfra.com/page/inventory-data.html), [global arguments](https://docs.pyinfra.com/page/arguments.html) and [the CLI](https://docs.pyinfra.com/page/cli.html) or check out the [documented examples](https://docs.pyinfra.com/page/examples.html).

0 commit comments

Comments
 (0)