Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.3.1
current_version = 2.3.2
commit = True
tag = True
tag_name = {new_version}
Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ workon ops
# uninstall previous `ops` version (if you have it)
pip uninstall ops --yes

# install ops-cli v2.3.1 stable release
# install ops-cli v2.3.2 stable release
pip install --upgrade ops-cli
```

Expand All @@ -167,7 +167,7 @@ You can try out `ops-cli`, by using docker. The docker image has all required pr

To start out a container, running the latest `ops-cli` docker image run:
```sh
docker run -it ghcr.io/adobe/ops-cli:2.3.1 bash
docker run -it ghcr.io/adobe/ops-cli:2.3.2 bash
```

After the container has started, you can start using `ops-cli`:
Expand Down Expand Up @@ -538,6 +538,23 @@ If there are connection issues double check that the proxy is running.
...
```

#### Teleport
Teleport (https://goteleport.com/) provides secretless SSH.
`ops` has support for using Teleport as ssh for the following operations: `ssh, tunnel, proxy, ansible play, run and sync`

In order to use Teleport an extra section needs to be added to the cluster config file:
***
```
inventory:
- plugin: cns
args:
teleport_enabled: True -> add this to existing configuration


teleport:
enabled: true -> add this whole block
```

### Play

Run an ansible playbook.
Expand Down Expand Up @@ -762,7 +779,7 @@ env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/

## Running tests

- on your machine: `py.test tests`
- on your machine: `python -m pytest tests` or `build_scripts/run_tests.sh`

# Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
_requires = [r for r in open(os.path.sep.join((_mydir, 'requirements.txt')), "r").read().split('\n') if len(r) > 1]
setup(
name='ops-cli',
version='2.3.1',
version='2.3.2',
description='Ops - wrapper for Terraform, Ansible, and SSH for cloud automation',
long_description=_readme + '\n\n',
long_description_content_type='text/markdown',
Expand Down
2 changes: 2 additions & 0 deletions src/ops/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,7 @@ def configure_common_ansible_args(parser):
parser.add_argument('--noscb', action='store_false', dest='use_scb',
help='Disable use of Shell Control Box (SCB) even if '
'it is enabled in the cluster config')
parser.add_argument('--teleport', action='store_false', dest='use_teleport',
help='Use Teleport for SSH')

return parser
6 changes: 4 additions & 2 deletions src/ops/cli/playbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ def __init__(self, ops_config, root_dir, inventory_generator,
def run(self, args, extra_args):
logger.info("Found extra_args %s", extra_args)
inventory_path, ssh_config_paths = self.inventory_generator.generate()
ssh_config_path = SshConfigGenerator.get_ssh_config_path(self.cluster_config,
ssh_config_generator = SshConfigGenerator(self.ops_config.package_dir)
ssh_config_path = ssh_config_generator.get_ssh_config_path(self.cluster_config,
ssh_config_paths,
args.use_scb)
args)

ssh_config = f"ANSIBLE_SSH_ARGS='-F {ssh_config_path}'"

ansible_config = "ANSIBLE_CONFIG=%s" % self.ops_config.ansible_config_path
Expand Down
5 changes: 3 additions & 2 deletions src/ops/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def run(self, args, extra_args):
logger.info("Found extra_args %s", extra_args)
inventory_path, ssh_config_paths = self.inventory_generator.generate()
limit = args.host_pattern
ssh_config_path = SshConfigGenerator.get_ssh_config_path(self.cluster_config,
ssh_config_generator = SshConfigGenerator(self.ops_config.package_dir)
ssh_config_path = ssh_config_generator.get_ssh_config_path(self.cluster_config,
ssh_config_paths,
args.use_scb)
args)
extra_args = ' '.join(args.extra_args)
command = """cd {root_dir}
ANSIBLE_SSH_ARGS='-F {ssh_config}' ANSIBLE_CONFIG={ansible_config_path} ansible -i {inventory_path} '{limit}' \\
Expand Down
Loading