Skip to content

Instantly share code, notes, and snippets.

@andmos
Created January 3, 2018 18:56
Show Gist options
  • Save andmos/3e21275d1695d4faff617b79adf4bc2a to your computer and use it in GitHub Desktop.
Save andmos/3e21275d1695d4faff617b79adf4bc2a to your computer and use it in GitHub Desktop.
#!/bin/bash
hostname="{{ ansible_host }}"
serverUrl="{{ octopusHost }}"
apiKey="{{ octopusAPIKey }}"
localIp="{{ ansible_default_ipv4.address }}"
environment="{{ octopusEnvironment }}"
accountId="{{ octopusSSHAccount }}"
fingerprint=$(ssh-keygen -E md5 -lf /etc/ssh/ssh_host_rsa_key.pub | cut -d' ' -f2 | cut -d: -f2- | awk ' { print $1}') #MD5
machineName="{{ ansible_hostname }}"
roles="{{ octopusRoleEnvironment|join(',') }}"
dotnet script ConfigureSSHTentacle.csx -- "$serverUrl" "$apiKey" "$environment" "$hostname" "$localIp" "$fingerprint" "$accountId" "$roles"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment