CLI script to work with Ansible hosts file
Project description
CLI script to work with Ansible hosts file
To install:
pip install ansible-hostmanager
After installing, set location to Ansible hosts file:
$ ah set-hosts ~/workspace/infra/cm/hosts Found 4 host(s)
To show hosts:
$ ah list app-server1 1.2.3.4 [app, all] web-server 1.2.3.5 [web, all] app-server2 1.2.3.6 [app, all] db-server 1.2.3.7 [db, all] $ ah list app app-server1 1.2.3.4 [app, all] app-server2 1.2.3.6 [app, all]
To ssh to a host:
$ ah ssh db # Runs `ssh 1.2.3.7` $ ah ssh app Found multiple matches and will use first one: app-server1, app-server2 # Runs `ssh 1.2.3.4`
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ansible-hostmanager-0.0.2.tar.gz
.
File metadata
- Download URL: ansible-hostmanager-0.0.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3532fdbef68924e099a0c900262a1012b731082e50863602632506877aa2de6 |
|
MD5 | 6ba71d2742665b1ab9360960cac81b48 |
|
BLAKE2b-256 | 5d34b0b9053805a22cb8b3f854e5e7d51d776a19c44b04be8d9d1f16125e6e69 |