Start a container to build iptables from source
docker run --rm -it -w /srv/build \
-v /srv/build/:/srv/build \
-v /usr/local:/usr/local \
debian:bookworm
In the container build iptabes
#!/bin/bash | |
set -euo pipefail | |
set -x | |
virtualenv_path=/usr/local/ansible/stable | |
# Install packages needed on a base Debian system | |
apt-get update | |
</dev/null DEBIAN_FRONTEND=noninteractive \ | |
apt-get --yes install --no-install-recommends $( |
Start a container to build iptables from source
docker run --rm -it -w /srv/build \
-v /srv/build/:/srv/build \
-v /usr/local:/usr/local \
debian:bookworm
In the container build iptabes
Since people still seem to be having problems with this, I thought I would post my solution for getting a pretty reliable agent into WSL2.
I have found the npipe+socat options pretty unstable, and frustrating.
My solution for getting an agent into WSL uses a combination of WSL2 systemd support, OpenSSH server installed in WSL2, and using OpenSSH client in Windows.
Prepare the environment
ssh-add.exe -L
--- | |
- hosts: switches | |
gather_facts: no | |
vars: | |
track_changes: yes | |
data_dir: "data/switches" | |
tasks: | |
- name: create data directory if needed | |
file: |
--- | |
# signing key generated with | |
# | |
# ssh-keygen -t ed25519 -f 20200624_ca_ed25519 -C 20200624_ca_ed25519 -N "" | |
# | |
# encrypted with ansible-vault | |
# | |
# ansible-vault encrypt 20200624_ca_ed25519 | |
- hosts: localhost:linux_systems |
# all the ansible python packages will be nicely self contained in this directory. | |
virtualenv_path=/usr/local/ansible/stable | |
mkdir -p /etc/ansible | |
mkdir -p ${virtualenv_path} | |
# Create requirements file for pip | |
# and more, or remove as needed. | |
echo " | |
ansible | |
ansible-lint |
#!/bin/bash | |
# adapted from https://github.com/yaegashi/ansible-snippets/blob/master/gnupg/ansible-gpg-file.sh | |
# ansible.cfg | |
# [defaults] | |
# # decryption passphrase and key in lastpass | |
# vault_password_file = ./gpg-vault-file.sh | |
if [ -z "$GPG_TTY" ]; then |
# adapted from https://gist.github.com/nathanielc/9b98350ccbcbf21256d7 | |
[Unit] | |
Description=Minecraft Server %i | |
[Service] | |
Environment="JAVABIN=/usr/bin/java" "JAVAOPTS=-Xmx1024M -Dlog4j.configurationFile=log4j2.xml" "MCJAR=paperclip.jar" "MCOPTS=-- | |
log-strip-color" | |
EnvironmentFile=-/srv/mc/%i/environment |
<# | |
.SYNOPSIS | |
Demonstration of accepting credentials in a variable or file | |
.DESCRIPTION | |
This is only an demonstration of how a script can accept either a file | |
with stored credentials, or a PSCredential object, so that it can be used | |
performing tasks that require authentication. | |
.PARAMETER CredentialFile |