> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# orbiously/tailscale

An executor-agnostic orb to connect the build-host to your Tailnet and establish a link with another Tailscale machine, which can then optionally be used as a bastion/jump host


## Commands

### connect

Use this command to connect the build-host to your Tailnet and confirm reachability of the Tailscale destination host (specified in the `ts-dst-host` parameter).


| Parameter | Type | Default | Description |
|---|---|---|---|
| `ts_auth_key` | env_var_name | TS_AUTH_KEY | Name of the environment variable containing the Tailscale authentication key. |
| `ts_dst_host` | string |  | Tailscale IP/hostname of the Tailscale host you want to connect to or use as a bastion/jump host. |
| `ts_max_pings` | integer | 10 | Maximum number of pings to send to `ts_dst_host`. |

### disconnect

Use this command to disconnect connect from Tailscale.


### install

Use this command to install Tailscale (note: if the job uses the Docker executor, this command will also install tmux)


## Examples

### connect-with-key-in-custom-env-var

Connect to Tailscale using an auth key stored in a custom-named environment variable and send a file to the remote Tailscale host via Taildrop


```yaml
version: '2.1'
orbs:
  tailscale: orbiously/tailscale@1.0.0
jobs:
  one-amazing-job:
    docker:
      - image: cimg/base:2022.08
    resource_class: small
    steps:
      - tailscale/install
      - tailscale/connect:
          ts-auth-key: MY_TS_KEY
          ts-dst-host: 100.121.112.23
      - run:
          command: >
            echo "I <3 CircleCI" > my_file.txt

            ### Now let's send the file using the `tailscale file` subcommand
            ### of the Tailscale CLI. (https://tailscale.com/kb/1080/cli/#file)

            sudo tailscale file cp my_file.txt 100.121.112.23:

            echo "I bet there's now a file named `my_file.txt` stored on the
            host with the Tailscale IP `100.121.112.23`"
          name: Sending a file via Tailscale
      - tailscale/disconnect
workflows:
  use-my-orb:
    jobs:
      - one-amazing-job
```

### connect-with-key-in-default-env-var

Connect to Tailscale using an auth key stored in the default environment variable.

```yaml
version: '2.1'
orbs:
  tailscale: orbiously/tailscale@1.0.0
  win: circleci/windows@5.0.0
jobs:
  my-perfect-job:
    executor:
      name: win/default
    steps:
      - tailscale/install
      - tailscale/connect:
          ts-dst-host: freddy-fazbear
      - run: echo "Run some code here"
      - tailscale/disconnect
workflows:
  use-my-orb:
    jobs:
      - my-perfect-job
```