Skip to content
Merged
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
1 change: 1 addition & 0 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def bootstrap(path, limit, password_file=None):
variables = dict(host, tg_bootstrap_phase=phase,
ansible_user=admin['user'] if phase == 'policy' else admin['bootstrap_user'],
ansible_ssh_private_key_file=str(key) if phase == 'policy' else admin.get('bootstrap_private_key_file', str(key)))
variables.setdefault('ansible_python_interpreter', '/usr/bin/python3')
if phase == 'account' and admin.get('bootstrap_auth') == 'password':
password = Path(password_file).read_text().strip() if password_file else getpass.getpass(f'Initial SSH password for {name}: ')
if not password:
Expand Down
1 change: 1 addition & 0 deletions inventory.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ all:
children:
tg_proxies:
vars:
ansible_python_interpreter: /usr/bin/python3
ansible_user: deploy
# Listed public addresses come first; unlisted links follow in unspecified order.
tg_links_order: [tg.example.com]
Expand Down
1 change: 1 addition & 0 deletions inventory.mtproxy.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ all:
children:
tg_proxies:
vars:
ansible_python_interpreter: /usr/bin/python3
ansible_user: deploy
# Listed public addresses come first; unlisted links follow in unspecified order.
tg_links_order: [tg.example.com]
Expand Down
1 change: 1 addition & 0 deletions inventory.ssh.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ all:
children:
tg_proxies:
vars:
ansible_python_interpreter: /usr/bin/python3
ansible_user: deploy
# Listed public addresses come first; unlisted links follow in unspecified order.
tg_links_order: [tg.example.com]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
from unittest.mock import patch

import bootstrap


Expand Down Expand Up @@ -36,6 +37,7 @@ def test_failed_new_access_keeps_policy_unchanged(self, run, output, probe):
phases = []
def phase(command, **kwargs):
data = YAML().load(Path(command[2]))
self.assertEqual(data['all']['hosts']['node']['ansible_python_interpreter'], '/usr/bin/python3')
phases.append(data['all']['hosts']['node']['tg_bootstrap_phase'])
return type('Result', (), {'returncode': 0})()
run.side_effect = phase
Expand Down
Loading