text
stringlengths
7
369
[2071.82 --> 2072.96] and now it's done.
[2073.36 --> 2074.58] One of my favorite tricks
[2074.58 --> 2076.02] in this particular task
[2076.02 --> 2076.98] and there are a couple.
[2076.98 --> 2079.20] One is to use JSON query
[2079.20 --> 2081.72] to create a dictionary
[2081.72 --> 2083.56] that I can then split
[2083.56 --> 2084.82] and join and what have you
[2084.82 --> 2086.46] within the task itself.
[2087.22 --> 2089.04] The other one is to use
[2089.04 --> 2091.14] what's called a ternary operator.
[2091.76 --> 2092.30] Now, Ginger,
[2092.46 --> 2093.78] which is the templating language
[2093.78 --> 2094.70] that Ansible has,
[2095.42 --> 2096.56] is pretty amazing
[2096.56 --> 2098.12] and you can do a lot of cool stuff.
[2098.48 --> 2099.66] But I was running into an issue
[2099.66 --> 2102.54] where my item.active contents
[2102.54 --> 2104.12] was either true or false
[2104.12 --> 2105.60] and the Ansible module
[2105.60 --> 2106.50] was expecting
[2106.50 --> 2109.04] the phrase present or absent.
[2109.32 --> 2110.24] Now, you as a human
[2110.24 --> 2111.10] can work out that
[2111.10 --> 2112.12] true equals present
[2112.12 --> 2113.60] and the absent equals false.
[2114.42 --> 2115.76] Computer is stupid.
[2116.00 --> 2116.94] You have to tell computer
[2116.94 --> 2117.42] this thing.
[2118.14 --> 2120.12] Turns out with the ternary operator,
[2120.38 --> 2121.48] we can actually do that.
[2121.74 --> 2122.80] So if we pass in
[2122.80 --> 2124.06] a true or false statement
[2124.06 --> 2126.14] into the ternary operator
[2126.14 --> 2127.12] and then specify
[2127.12 --> 2128.44] just a couple of other values,
[2129.08 --> 2130.52] present and absent in this case,
[2130.70 --> 2132.12] we can have true or false
[2132.12 --> 2133.98] actually be any other string
[2133.98 --> 2134.78] that we require.
[2135.46 --> 2136.20] Very simple.
[2136.20 --> 2136.98] Very cool.
[2136.98 --> 2139.96] tailscale.com
[2139.96 --> 2141.44] slash self-hosted.
[2141.52 --> 2142.00] Go there to get
[2142.00 --> 2142.98] a free personal account
[2142.98 --> 2144.42] for up to 20 devices
[2144.42 --> 2146.08] and you support the show.
[2146.52 --> 2148.60] Tailscale is a zero-config VPN.
[2148.96 --> 2150.24] You get it on any device
[2150.24 --> 2150.82] in minutes.
[2151.00 --> 2151.64] It'll manage
[2151.64 --> 2152.68] your firewall rules.
[2152.78 --> 2153.30] It'll help with
[2153.30 --> 2154.26] double-carrier grade,
[2154.36 --> 2155.00] crazy NAT,
[2155.10 --> 2155.70] all of that.
[2155.80 --> 2156.74] I'm using Tailscale
[2156.74 --> 2158.16] right now.
[2158.66 --> 2159.22] In fact,
[2159.56 --> 2160.30] Alex and I were using
[2160.30 --> 2161.50] Tailscale earlier today
[2161.50 --> 2162.16] as well
[2162.16 --> 2163.24] in a way that I haven't
[2163.24 --> 2164.14] really used it before.
[2164.26 --> 2165.16] Tell me about the fanciness
[2165.16 --> 2165.68] that we were doing.
[2165.82 --> 2166.64] Share it with the people,
[2166.74 --> 2166.96] actually.
[2167.22 --> 2168.42] Well, I span up Tandor
[2168.42 --> 2169.32] on my LAN
[2169.32 --> 2170.06] and I thought,
[2170.14 --> 2170.88] oh, it'd be pretty cool
[2170.88 --> 2171.78] if I could just share
[2171.78 --> 2173.16] this demo instance with Chris
[2173.16 --> 2174.12] because you're having some issues
[2174.12 --> 2175.08] with their public demo.
[2175.58 --> 2177.60] So I went into my Tailscale dashboard
[2177.60 --> 2179.36] and I clicked sharing settings,
[2180.00 --> 2181.30] got a link to share
[2181.30 --> 2182.58] one of my specific hosts,
[2183.02 --> 2183.72] my Docker host,
[2183.82 --> 2184.30] with you.
[2184.74 --> 2186.12] You accept a couple of things
[2186.12 --> 2187.44] in your Tailscale dashboard
[2187.44 --> 2188.20] on your end.
[2188.68 --> 2189.24] Straight away,
[2189.32 --> 2190.02] you've got access
[2190.02 --> 2191.68] just to that specific host,
[2192.14 --> 2193.12] but you could also use it
[2193.12 --> 2194.26] as an exit node as well.
[2194.40 --> 2196.06] So let's say you have a friend
[2196.06 --> 2197.94] geographically
[2197.94 --> 2200.40] in a useful place for you.
[2200.58 --> 2201.76] You could ask that friend
[2201.76 --> 2203.26] to share just that VM
[2203.26 --> 2204.20] or whatever it is
[2204.20 --> 2205.50] and you won't have access
[2205.50 --> 2207.48] to the rest of that person's LAN
[2207.48 --> 2209.42] only to that specific host