Skip to content

Commit

Permalink
Update deprecated ansible_ssh_ variables
Browse files Browse the repository at this point in the history
Change deprecated "ansible_ssh_{host,user,port}" variables to just
"ansible_{host,user,port}".
  • Loading branch information
rmol committed Apr 20, 2020
1 parent b5b4c3a commit e692dad
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion install_files/ansible-base/group_vars/all/securedrop
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ install_local_packages: false
ci_builder: false

# Ansible v1 default reference to remote host
remote_host_ref: "{{ ansible_ssh_host|default(inventory_hostname) }}"
remote_host_ref: "{{ ansible_host|default(inventory_hostname) }}"

# Packages required for working on SecureDrop within development VM. Same list
# is used on the build VM to pull in required packages.
Expand Down
5 changes: 2 additions & 3 deletions install_files/ansible-base/inventory
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
# 1. Set up HidServAuth in your torrc with the values from app-ssh-aths and mon-ssh-aths
# 2. Replace the IP addresses here with the corresponding .onion addresses
#
app ansible_ssh_host=10.20.1.2 ansible_ssh_port=22
mon ansible_ssh_host=10.20.2.2 ansible_ssh_port=22

app ansible_host=10.20.1.2 ansible_port=22
mon ansible_host=10.20.2.2 ansible_port=22
4 changes: 2 additions & 2 deletions install_files/ansible-base/inventory-dynamic
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ def build_inventory():
"_meta": {
"hostvars": {
h: {
"ansible_ssh_host": lookup_ssh_address(h),
"ansible_ssh_user": lookup_admin_username(),
"ansible_host": lookup_ssh_address(h),
"ansible_user": lookup_admin_username(),
} for h in SECUREDROP_SUPPORTED_HOSTNAMES
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# We only want to prevent upgrades if we're connected over Tor; first-time
# installs will happen over direct access SSH (to local IPv4 address).
# If we're connecting to an Onion URL, then it's over Tor.
- (ansible_host|default(ansible_ssh_host)).endswith('.onion')
- (ansible_host|default(ansible_host)).endswith('.onion')

- name: Perform safe upgrade to ensure all the packages are updated.
apt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
- name: Waiting for SSH connection (slow)...
local_action: wait_for
args:
host: "{{ _hostname_to_wait_for }}"
port: "{{ ansible_ssh_port|default(ansible_port|default(22)) }}"
host: "{{ remote_host_ref|default(ansible_host) }}"
port: "{{ ansible_port|default(ansible_port|default(22)) }}"
delay: 30
search_regex: OpenSSH
state: started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
- tor_instances_v3|length > 0
# Only run if we're connected over Tor (i.e. enabling v3 after v2).
# If we're not connected over Tor, this is a first-run.
- (ansible_host|default(ansible_ssh_host)).endswith('.onion')
- (ansible_host|default(ansible_host)).endswith('.onion')

0 comments on commit e692dad

Please sign in to comment.